Hacker News new | ask | show | jobs
by dpratt 3307 days ago
Any benchmark that includes a JVM language always makes me look for a disclaimer that they allowed for proper JIT/warming time by running the benchmark a few times in the same VM instance before collecting the numbers. I may have missed it in this article, but I didn't see it.

Yes, startup time is a concern with the JVM, but that's not what it's built for - it's meant for long-runnning repeatable code paths.

4 comments

> that's not what it's built for

There was nothing in the original design that said "only long running server processes". In fact, Java was originally aimed at set-top boxes, then web applets, then cross platform GUI apps. It was only after it failed in all of these that the server was discovered, despite the fact that "write once, run anywhere" is almost completely pointless when you control the hardware it runs on.

The long startup times are a limitation of the implementation technology, not a principled design choice. See also: Jitterdämmerung ( http://blog.metaobject.com/2015/10/jitterdammerung.html )

Any comments that "startup time is a concern with the JVM" always make me look for evidence that the person has made some attempt to investigate startup time for the specific circumstances they discuss.

http://benchmarksgame.alioth.debian.org/sometimes-people-jus...

He doesn't do warmups for JITted languages.
...which means the measurements are meaningless. They will include the time to analyse the hot paths and then compile them.
They will include a few tenths of a second.

Note the timings are seconds and tens-of-seconds.

A program written in C will execute faster if you run it multiple times, and slower if it has not been run recently. Presumably all of the benchmarks consist of many thousands of repetitions of the same process.
The difference is not as dramatic as with the JVM.
The difference is not as dramatic with tiny tiny programs that run for more than a few tenths of a second.
Oh, yes it is. I've benchmarked code I've written in C++ vs Java before and allowing hotspot to optimise the code makes a huge difference
How "huge" on a 20 second run of nbody 50000000 ?

http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...

The measurement shown is 21.54 secs.

The average JMH shows is 23.367 ± 0.062.