Thank you for informing me about the existence of GraalVM. I've never heard about it.
The binary size comparison is interesting.
As for measuring time: Doing it once is useless. The rest of the system surely impacted those times more than the programs themselves. Also, they are so tiny, they have no informative value. - All we know is that it does not start a runtime VM, that would take as long as JVM to start.
A more interesting "hello world" benchmark would be maybe something like: allocating a few hundred thousand objects and sorting them - repeating 50 times, or so.
Just for fun I have implemented a decent utility in Java, Rust, Go, and then modified Java version to be compile it to native image. Surprisingly: Java based native image outperformed even Rust version. I suspect that it can be attributed to high quality implementation of JSON parser. 93ms vs 125ms
Thank you for informing me about the existence of GraalVM. I've never heard about it.
The binary size comparison is interesting.
As for measuring time: Doing it once is useless. The rest of the system surely impacted those times more than the programs themselves. Also, they are so tiny, they have no informative value. - All we know is that it does not start a runtime VM, that would take as long as JVM to start.
A more interesting "hello world" benchmark would be maybe something like: allocating a few hundred thousand objects and sorting them - repeating 50 times, or so.
Feel free to try it out.
Just for fun I have implemented a decent utility in Java, Rust, Go, and then modified Java version to be compile it to native image. Surprisingly: Java based native image outperformed even Rust version. I suspect that it can be attributed to high quality implementation of JSON parser. 93ms vs 125ms
github.com/kgignatyev/hiera-ctp