hedge
hedge copied to clipboard
Compiling multiple functions (even simple) referred in hedge.edn requires too much system resources
This might be related to #65
Case:
- hedge.edn with 10 functions.
- one core.cljs with the 10 handlers
- the function handlers are stubs (mainly one-liners that return a constant value or a simple map of something)
- Docker CI container with 4 CPUs and 4 gigabytes of memory runs out of resources and build aborts after 30 minutes failing to complete
Stack trace of root exception is empty; this is likely due to a JVM optimization that can be disabled with -XX:-OmitStackTraceInFastThrow.
adzerk.boot_cljs.util.proxy$java.lang.Throwable$ff19274a: Java heap space
adzerk.boot_cljs.util.proxy$clojure.lang.ExceptionInfo$ff19274a: Java heap space
from: :boot-cljs
clojure.lang.ExceptionInfo: Java heap space
line: 25
ERROR: Job failed: exit code 1
Also, the build just takes too long compared to build time of a single function that is more complicated than just an one liner.
would there be a simple possibility to pass :parallel-build false as cljs options from commandline?
Yes but only if compiling multiple handlers otherwise argument will kill performance. Afaik @iisulop tested it.
Performance testing for 1, 2, 5 and 10 handlers?
Argument could be passed here: https://github.com/siilisolutions/hedge/blob/develop/boot/src/boot_hedge/azure/core.clj#L264 but getting amount of handlers might be harder to pass for that task.
Best solution: Fix boot-cljs to limit amout of clsj processes! That way closure compiler theading is enabled but boot does not invoke too many processes. :/