4 ms·
Handicapping one language to the featureset of another is unreasonable. You'd also have to disable a host of JVM features (such as hotspot) for a "fair" compari
by zamalek 6y ago
Handicapping one language to the featureset of another is unreasonable. You'd also have to disable a host of JVM features (such as hotspot) for a "fair" comparison, which is ridiculous.
Calling C is unfair, though. JVM can do the same and it should be implemented the same way.
- bitbckt 6y agoReferring to Hotspot as a “feature” of the JVM is a gross mischaracterization. A JVM is not Hotspot, and Hotspot is not a part of “the” JVM.
- 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.
- erik_seaberg 6y agoThere's a big difference between "C# is fast" and "C# might be fast if you're extremely reckless". For me only the former is useful.
- zamalek 6y agoSIMD is not reckless.
- erik_seaberg 6y agoIf it can be used safely in production, great, but I'm not seeing that here.
- igouy 6y agoNote the `C# .NET Core #5` and `Java #3` programs. Note the `C# .NET Core #4` and `Java #2` programs. https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/pidigits.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- zamalek 6y agoYes, C# is currently a more expressive language for performance than Java is, and can score much higher with tighter code. I wouldn't trust the opinion of someone who claims otherwise by ignoring the facts (as demonstrated by your link). The specific benchmarks in the OP are not objective and fair. I personally want nothing to do with Java, its glacial progress and Oracle's lawyers. But fair is fair. Using facts to prove a point (as you have) means that quality facts are needed. The OP is not quality facts.
- igouy 6y agoThe pidigits benchmark in the OP shows exactly the same facts that I posted.