(no title)
gw2 | 1 year ago
* Span<T>: https://learn.microsoft.com/en-us/archive/msdn-magazine/2018...
* C# now has a limited borrow checker-like mechanism to safely handle local references: https://em-tg.github.io/csborrow/
* Here is a series of articles on the topic: https://www.stevejgordon.co.uk/writing-high-performance-csha...
* In general, avoid enterprise style C# (ie., lots of class and design patterns) and features like LINQ which allocate a lot of temporaries.
neonsunset|1 year ago
Also can recommend reading all the performance improvements blog posts by Stephen Toub as well as learning to understand disassembly at a basic level which .NET offers a few convenient tools to get access to.
codr7|1 year ago
Helped me a bunch to get Sharpl spinning, much appreciated.
https://github.com/codr7/sharpl
graboid|1 year ago
neonsunset|1 year ago
xigoi|1 year ago
jiggawatts|1 year ago
C# is Java-but-with-lessons-learnt, and is significantly less verbose and "enterprisey" in typical usage.
Modern .NET 9 especially embraces compile-time code generation, a "minimal" style, and relatively high performance code compared to Java.
Even if the JVM is faster in benchmarks for hot loops, typical Java code has far more ceremony and overhead compared to typical C# code.
gw2|1 year ago
Then why would they add Span<T>, SIMD types and overhaul ref types in the first place?