4 ms·
> Java is only slow to start the VM And it's not even that slow anymore compared to, say, starting the JVM in 2010. Some numbers for those curious... On mode
by TacticalCoder 3y ago
> Java is only slow to start the VM
And it's not even that slow anymore compared to, say, starting the JVM in 2010.
Some numbers for those curious...
On modern hardware launching the JVM to run a program immediately exiting takes less than 100 ms (so does starting Emacs complete with its GUI and running some elisp code exiting Emacs: 80 ms on my Ryzen 7000 series including reading from the M.2 NVMe PCIe 4.0 x4 SSD).
It's once you start loading lots of classes that JVM startup time can be slow.
One example would be a Clojure program doing nothing besides exiting: thousands of Java classes being used and you get into 1.2 seconds territory to do nothing. 12x slower than a Java program doing nothing.
As a sidenote for both Java and Clojure there are now ways to reduce startup time, like using GraalVM (which, for example, Babashka, a natively compiled Clojure interpreter, making Clojure startup so fast it can be used for scripts).
> The JVM is really really good because at one point or another they had basically every luminary in the field working on it.
I agree. The JVM is an impressive piece of machinery and it'll even give you, say, an AIOOBE (ArrayIndexOutOfBoungsException) instead of an exploit if you fuck up.
- nvy 3y ago>so does starting Emacs complete with its GUI I'm with you all the way and am a daily emacs user but I'm not sure I'd point to emacs as a good performance comparison, haha. Emacs has always been a bit of a dog in my experience.