Tonight I ran some simple performance tests on my laptop, to estimate the performance differential between C++ and Java for Jolt physics simulation. The benchmark I used is called "Ragdoll".
I expected JPH (the C++ app) to achieve slightly more throughput (steps/second) than Jolt JNI (the Java app), for both the Discrete and LinearCast variants of the benchmark.
I ran each curve 3 times (12 runs in total) and plotted the median throughputs.
My expectation was met for < 6 threads and/or the Discrete variant. Between 5 and 6 threads, however the LinearCast curves cross, and for > 5 threads the Java app is faster than C++, but only on LinearCast.
It's hard to imagine anything intrinsic to the apps that would cause the curves to cross like that.
I suspect something running on my laptop interfered with the measurements. Luckily I still have the raw data, so I took a closer look.
2 of the 3 blue runs showed a slight drop in throughput between 5 and 6 threads. The other 10 runs showed substantial increases in throughput between 5 and 6 threads. Coincidence? Maybe.
Tomorrow I'll collect more data.