Re:(Yet Another) Lisp in Go
by tmountain on Sunday May 08, 2022 @09:25AM
(#31303768)
Yup, once hotspot kicks in on the JVM, a toy language is going to have a hard time competing with that performance. It’s definitely disingenuous to include JVM start up time in any benchmark. I used to run clojure benchmarks in a REPL and I would watch as the functions I was testing dramatically increased in performance over a few invocations. JIT compilation is pretty incredible.
[ Parent
| on HN ]
Re:(Yet Another) Lisp in Go
by DeathArrow on Sunday May 08, 2022 @09:51AM
(#31303956)
>JIT compilation is pretty incredible.
Not if you compare to AOT for languages who lack garbage collectors. C, C++, Fortran would still be quite faster.
Re:(Yet Another) Lisp in Go
by tsimionescu on Sunday May 08, 2022 @03:57PM
(#31307590)
There are some workloads where Java's JIT can beat C, C++, Fortran AOT compilation. They are probably not very common, but stuff like un-inlining can really save on instruction cache misses in workloads where the most likely path is consistent for fixed periods of time, but changes relatively often (for something like `if COND { foo(); } else { bar(); }` in a hot loop, where COND is sometimes true for a while than false for another while).
Of course, Java also has a lot of overhead from the language and implementation level, because of things like no generic lists of integers, no struct embedding leading to lots of pointer-chasing, a tendency for over-allocation, and direct overhead of the advanced JIT itself - performance counters, dummy instructions to support de/re-optimizations on the fly etc.
Given sufficient time and a sufficiently expert programmer. It is not that easy to beat Java for complex programs where your workload is really variable and can’t use the usual tools like arenas.
JIT cache is the answer, or one of the AOT compilers that exist for ages.
> It’s definitely disingenuous to include JVM start up time in any benchmark.
It's not since startup time matters for CLI applications.