4 ms·
Are we looking at the same file?[0] Tons of very "interesting" attributes like this: // prevent inlining into main to decrease JIT time to generate main
by coder543 5y ago
Are we looking at the same file?[0]
Tons of very "interesting" attributes like this:
// prevent inlining into main to decrease JIT time to generate main
[SkipLocalsInit][MethodImpl(NoInlining)]
[SkipLocalsInit][StructLayout(LayoutKind.Explicit, Pack = 32)]
[SkipLocalsInit][MethodImpl(AggressiveOptimization | NoInlining)]
[FieldOffset(32)]
and tons of "unchecked" blocks.
Not to mention that the entire file is using explicit vectorization, which I consider to be a very high degree of optimization -- tons of software never bothers to implement explicit vectorization, and does just fine.
If all of this is "nothing out of the ordinary", then "ordinary" C# has changed a lot since I last spent much time with it.
[0]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/nbody-csharpcore-7.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- alkonaut 5y agoAgree - those attributes are definitely “low level” and not idiomatic in most situations. I must have missed them skimming that file. For the particular case of n-body you could argue you are already in a pretty extreme HPC world and doing it without vectors would basically be a toy calculator. The problem then of course that C# isn’t really ever idiomatic for that. The question (as alaways) becomes about what to compare. Typical or pushed to the limit.
- igouy 5y agoChoices! choices! https://benchmarksgame-team.pages.debian.net/benchmarksgame/measurements/csharpcore.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...