|
|
|
|
|
by dig1
998 days ago
|
|
The recurring problem I've seen that would cause slow startup is cramming many (require) and (import) in the project core.clj file - for non-clojure devs here, this means including a lot of dependencies in the file called on the startup. By reordering things to be loaded smartly or lazily, startup speed can be improved a lot. Another reason for a slow startup is that Clojure must load its own runtime every time. The current compiler is not a tree shaker, nor can it rewrite complex expressions in compile-time, although many clojure.core functions were rewritten over time to accommodate JVM optimizers. However, Graal is here precisely to do at the bytecode level, as long as you take care of all type hint warnings and avoid things Graal can't see during compilation (e.g. deferring evaluation of some expressions for runtime). |
|