lithander wrote: ↑Tue Dec 28, 2021 12:01 am
Today I installed Visual Studio 2022 and changed my (unpublished) bitboard perft experiments to target .Net 6 (instead of .Net 5) and was delighted to see a
10% gain in performance just by targeting a newer framework. (45M Nps perft instead of 40M)
...so of course I thought of our little community project here where we tried to make a C# port of the QBB perft routine as fast as possible. In the end the gap between C/C++ and C# was only 10M NPS and so... with another 10% speed boost the gap would have finally been negligible.
But the .Net 6 version of
QBB-Perft turned out to
lose 8M NPS over the .Net 5 build making it
15% slower.

I mean it's great that my own routines gained speed (because those I'm going to use for my future chess programming) but I would have really expected more consistent results here... after all both are bitboard based chess engines running the same perft test?!
What are your experiences with .Net 6 performance? (If you tried it yet...)
P.S.: I used a Ryzen 3600 @ 4.2Ghz on Windows 10
Have you used the [MethodImploptions.AggressiveInlining] yet? It makes a big difference.
Also donet has had the option for ahead of time compilation which could also help in terms of performance.
In theory JIT compiled languages could surpass statically compiled languages in terms of performance - but this hasnt happened yet - and wont in the near future, because these languages have had design choices that have a runtime cost associated with them.
One example would be pointer aliasing which doesnt have a keyword in C++ and if the compiler cant prove that then SIMD is off limits.
With C# and JIT the compiler could "prove" for all known inputs that no overlap exists during runtime and just emit the SIMD code.
Also think about that you cannot ever ever compile with march=native and expect your software to run anywhere else without recompilation. With JIT march=native would be the default behaviour.
Oh what could have been...