4 ms·
> Calling C is unfair, though. JVM can do the same and it should be implemented the same way. If you want to benchmark C code you can just benchmark a C applic
by jsiepkes 6y ago
> Calling C is unfair, though. JVM can do the same and it should be implemented the same way.
If you want to benchmark C code you can just benchmark a C application. You run stuff in a VM like the JVM or CLR because you want things like memory safety. If you allow native code in something like a regex benchmark then all your benchmarks are basically about: How fast can the JVM/CLR call native code. And say absolutely nothing about how fast the VM itself is.
So using native code in these benchmarks is just silly and basically makes the whole thing meaningless.
- plorkyeran 6y agoHow fast your managed code can call native code is an extremely relevant performance detail sometimes. It's far from the only thing you should benchmark, but it is a useful thing to benchmark.
- magicalhippo 6y agoAbsolutely, but then that should be a separate benchmark, designed to test exactly that. Same with intrinsics. Have a benchmark that tests how good are the intrinsics, are there any significant overhead etc. When I look at generic names like "n-body sim" I'm thinking ok, let's see how generic mixed floating-point code compares between the languages.