Live data from Hacker News

Command-line apps with Clojure and GraalVM: 300x better startup times

astrecipes.net

1–10 of 66 posts

Re: Command-line apps with Clojure and GraalVM: 300x better startup times

#2
Generally speaking, startup times for Java / JVM based apps should be worked on next by the teams behind it; in the container age, fast startup is a good thing. I know the JVM itself starts up fast enough, but then going with e.g. Spring on top of that just adds a minute of startup time - and I've no clue what it's doing, I wouldn't think loading config, registering services and opening up a servlet thingy would take so long.

Re: Command-line apps with Clojure and GraalVM: 300x better startup times

#3
post #2

Generally speaking, startup times for Java / JVM based apps should be worked on next by the teams behind it; in the container age, fast startup is a good thing. I know the JVM itself starts up fast enough, but then going with e.g. Spring on top of that just adds a minute of startup time - and I've no clue what it's doing, I wouldn't think loading config, registering services and opening up a servlet thingy would take…

For Clojure, there is a complex set up of vars in the core namespaces - see e.g. https://dev.clojure.org/display/design/Improving+Clojure+Sta... - but GraalVM kills it. It's even worse for serverless!

Re: Command-line apps with Clojure and GraalVM: 300x better startup times

#4
post #2

Generally speaking, startup times for Java / JVM based apps should be worked on next by the teams behind it; in the container age, fast startup is a good thing. I know the JVM itself starts up fast enough, but then going with e.g. Spring on top of that just adds a minute of startup time - and I've no clue what it's doing, I wouldn't think loading config, registering services and opening up a servlet thingy would take…

I think the startup time in Spring got that long due to resolving graph of dependencies at runtime.

Re: Command-line apps with Clojure and GraalVM: 300x better startup times

#5
post #2

Generally speaking, startup times for Java / JVM based apps should be worked on next by the teams behind it; in the container age, fast startup is a good thing. I know the JVM itself starts up fast enough, but then going with e.g. Spring on top of that just adds a minute of startup time - and I've no clue what it's doing, I wouldn't think loading config, registering services and opening up a servlet thingy would take…

I think the startup time in Spring got that long due to resolving graph of dependencies at runtime.

I remember reading somewhere that Java 9 modules will solve exactly this, as only the required parts of libraries are loaded, and significantly on the used parts of the standard library.

Re: Command-line apps with Clojure and GraalVM: 300x better startup times

#7

Earlier quoted context omitted.

I think the startup time in Spring got that long due to resolving graph of dependencies at runtime.

I remember reading somewhere that Java 9 modules will solve exactly this, as only the required parts of libraries are loaded, and significantly on the used parts of the standard library.

The JVM already does that - it only loads things it needs. So you can have a 2M dependency and only use one static function of a single class in there, and it will only load that - but you have to distribute the whole JAR. With Jigsaw, things are split up, so you can have only the stuff you need.
Post reply on HN