Lazy loading of occasionally needed code
zane opened this issue · comments
Zane Shelby commented
Loading JavaScript is expensive. Definitions needed for intermittently used features like the REPL should not be read unless that feature is being used in a particular call.
$ time nbb -e '(+ 1 2 3)'
6
nbb -e '(+ 1 2 3)' 0.18s user 0.02s system 109% cpu 0.185 total
$ time nbb -e "(require '[clojure.pprint :as pprint])"
nbb -e "(require '[clojure.pprint :as pprint])" 0.21s user 0.02s system 107% cpu 0.213 total