niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
508 stars 79 forks source link

Added a version that uses java vector ops #105

Closed cnuernber closed 1 year ago

cnuernber commented 1 year ago

This version uses JDK-19 vector ops. Without any in-process warmup, it is slower than the original java version by quite a lot. I wonder if hyperfine could be modified to use nailgun or some similar system to allow the actual java JIT time to warmup.

Given a sufficient in-process warmup, it is a bit over twice as fast as the java version - https://github.com/cnuernber/leibniz.

It seems any JIT language is going to have this disadvantage honestly in this type of benchmark as they are only partially compiled at best.

In any case, our community (clojure) had a great time with this benchmark and we found some legitimate issues with our compiler.

Included in this PR is a small change that makes the Clojure version a bit faster.

niklas-heer commented 1 year ago

@cnuernber thank you for your contribution! 👍 CleanShot 2023-02-05 at 19 32 12@2x