xsc/pandect

Slow startup

sitepodmatt opened this issue · 1 comments

I noticed once including pandect in my project (to use sha1 fn) that the repl startup time slowed significantly, sometimes even in timing out. I isolated it to pandect by creating a minimal repl (isolated dependency graph), and finding the culprit looking like pandect, doing (require '[pandect.core]) takes upwards of 10 seconds?

I ripped it out and replaced with clj-digest as I only needed sha1 fn and everything is sane again, luckily due to same fn name and use :refer is ns only minimal changes.

xsc commented

@nonuby Since version 0.4.0 it's possible to have more directed access to hashing functions using pandect.algo.* namespaces - you are not alone in observing long loading times with pandect.core.

So, I recommend using the latest pandect version (0.4.1), as well as:

(ns your-ns
  (:require [pandect.algo.sha1 :refer [sha1]]))

See here for more documentation.


user=> (time (require 'pandect.core))
"Elapsed time: 3249.444 msecs"

... start fresh REPL ...

user=> (time (require 'pandect.algo.sha1))
"Elapsed time: 283.558 msecs"