How to speedup ClojureScript build?

While I don’t really mind Clojure’s long startup time during CLJS development, there can be reasons to speed it up for one-time tasks like creating JS production builds or running tests.

For example, we have a Python backend and my colleagues complain about CI tasks taking so long because of ClojureScript compilation, which requires lengthy Java warmup in contrast to Python interpreter.

Since there is no need for a JIT in this case, could it be possible to somehow speed it up using GraalVM? I’ve seen some examples of how to compile Clojure code into native binary with Graal’s native-image, but so far haven’t found an attempt to do this with Clojure and ClojureScript itself. It’s just a JAR, after all :slight_smile:.

Disclaimer: I’m a frontend developer, I don’t know much about Java or Graal, so sorry if no is the obvious answer here :slight_smile:.

which ClojureScript compiler / build tool are you using?

I use either lein-cljsbuild Leiningen plugin or shadow-cljs.

I don’t have an answers as well. When Lumo was developed, when shadow-cljs developed, I saw this question asked several times. Lumo and shadow-cljs added caches trying to make compilation faster except for the first compilation. There is lots of cost in code compilation. We may still need opinions from compiler and build tools maintainers.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.