- very naive code (shortest, most readable & easy to write code)
- idiomatic code
- optimized code without other-language-libs wrappers and without SIMD, single threaded
- optimized code without other-language-libs wrappers and without SIMD, multi-threaded
- optimized code without other-language-libs wrappers and with SIMD and/or multi-threaded
- optimized code with other-language-libs wrappers allowed and any other optimization technique2. We wouldn’t look at the benchmarks game if we thought an alternative presentation was more useful.
In this world where we also compare to C++ programs.
In this world where — as you acknowledge — we also compare a C# regex-redux program that does not use a third party library.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
> Interesting, why does it need that?
2 out of 10 tasks regex-redux and pidigits accept third-party libraries, the other 8 out of 10 tasks do not.
If you're also separately benchmarking the same C library running on its own, then it's quite interesting to benchmark a .NET wrapper around the exact same library, as it allows you to estimate the overhead from the .NET runtime itself as separated from user code (ideally you'd try this with a bunch of different C libraries).
Of course, the program should be very very clearly labelled accordingly. Since it was just labeled as "csharpcore", then I am inclined to think the submitter was treating the benchmark as a competition.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
c# regex redux - 1.42 seconds
java regex redux - 5.31 seconds
Ok... but looking at the code:
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
It's only using vanilla Java features.c# ?
Interesting, why does it need that? Aha! It's because the c# impl is really just a wrapper round a native C impl of the problem.In what world is this a useful comparison?
The fastest "real" c# solution is still faster than the java one though:
c# (real) - 3.1 seconds
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...