This is intended to help with profiling slow Clojure startup times:
- Create a csv with start/end times for loading namespaces
- Analyzer script that measures how long each namespace take (substracting time that's needed for loading its dependencies)
Requires building your own patched version of Clojure
Sample output (time in milliseconds):
["clojure/tools/reader/reader_types" 51]
["clojure/core/matrix/impl/defaults" 53]
["taoensso/timbre" 56]
["backend/test_system" 61]
["integrant/core" 77]
["aero/core" 78]
["buddy/core/keys/pem" 79]
["clojure/tools/reader" 85]
["buddy/core/mac" 86]
["clojure/core/specs/alpha" 98]
["amazonica/aws/simpleemail" 100]
["clojure/core/matrix/protocols" 126]
["clojure/core" 190]
["taoensso/encore" 313]
["backend/db" 391]
- apply patch to clojure 1.11.1
- mvn package
- find clojure jar in
target/
clojure -Sdeps '{:deps {org.clojure/clojure {:local/root "path-to-clojure-jar"}}}' ... 2>log.csv
bb analyze-clojure-load-log.clj log.csv