Re:A History of Clojure [pdf]
by keymone on Thursday June 04, 2020 @03:19PM
(#23420648)
JVM is not to blame here, it's Clojure that takes a while to load and initialize. Java actually crushes Python in every aspect in terms of performance (which is to be expected of statically typed language).
[ Parent
| on HN ]
GP specifically mentioned startup time. It's true that most of the startup time for Clojure projects is a Clojure-specific interplay of things the JVM does (but also not language-intrinsic: ClojureScript on V8 does not share that problem, for example), but default flags CPython still beats default flags OpenJDK for "start and do nothing".
> default flags CPython still beats default flags OpenJDK for "start and do nothing"
i stand corrected :)
it's not the static typing that makes a difference, it's the compilation. As an extreme example, asm is very much not statically typed (hell it's not even considered typed in most circles), and it beats the pants off of Java.
As another, less flippant, example, Julia will typically beat Java in most long-running algorithms (but probably not time-to-first-x), because it doesn't have a well-optimized-for-compilation-speed compiler, but it does have a better-optimized-for-running-speed compiler for many scientific tasks. https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
In that example, Julia also has someone who's spent many many hours writing and re-writing those few tiny programs to tune performance.
Last year I spent about twenty minutes writing mine (Julia #3) in the n-body example and it tied the naive java. I'm not even a Julia programmer anymore.