Glow brings in unnecessary dependencies and namespaces
Deraen opened this issue · comments
glow has dependency on hiccup and garden for generating html output, ultra doesn't use this feature.
Ultra uses glow.core
namespace to generate ansi output, this namepace requires glow.html
which depends on garden.core
and hiccup.core
. Compiling all these namespaces takes considerable time every time repl process is started.
To test this, I moved the ultra dependency vector from :plugins
to :dependencies
and ran (time (require 'glow.html))
on repl:
user=> (time (require 'glow.html))
"Elapsed time: 1226.618638 msecs"
user=> (time (require 'glow.html :reload-all))
"Elapsed time: 1419.59313 msecs"
user=> (time (require 'glow.html :reload-all))
"Elapsed time: 1080.967651 msecs"
Running :reload-all
also shows how long it takes to compile glow.html
and all the namespaces it depends on.
Solution:
- Use
glow.terminal
,glow.parse
andlow.colorschemes
directly instead of throughglow.core
- Add exclusion to
hiccup
andgarden
onvenantius/glow
dependency vector
Another way to debug this is running: time echo | lein repl
:
# without ultra
echo 0,00s user 0,00s system 0% cpu 0,001 total
lein repl 14,71s user 0,55s system 85% cpu 17,885 total
# with ultra
echo 0,00s user 0,00s system 0% cpu 0,001 total
lein repl 15,73s user 0,80s system 78% cpu 20,996 total
Can you take a look at current master and confirm that this satisfies this issue? Once you've confirmed that I'll deploy the release to Clojars.
Hmm, I thought I answered this already: Looks good, Thanks!