32:55 If I'm not mistaken, that optimization works only for bytes because of unknown endianness of target system where code is going to run. If span element is larger than a byte, a method stub is generated that creates an array instance at runtime and that read-only span points to it. No optimization.
5:25 Many people misinterpret what the "measuring" entails. They think that it only means "take the codebase as-is and start benchmarking". Well that's partially true - but only partially. Strictly speaking the biggest part of "measuring" in this phase starts with analyzing from an abstract point of view ("10km above the ground") how "sane" the architecture is to figure out whether the codebase has indeed placed the "horse in front the carriage" from an architectural perspective. Bad architectures and their absurdities cannot be spotted readily enough by "benchmarking" - you need an architectural mindset first in various domains to really spot bottlenecks. If you start with "benchmarking" you will probably miss out on many important bottlenecks. "You can't resolve a city-wide traffic jam by benchmarking and laser-focusing on the individual atoms of each and every car-engine involved."
Thank you for making this topic accessible! I appreciate the deep dive into optimizing .NET code, particularly around Span and System.IO.Pipelines. I’m curious about your thoughts on balancing these high-performance techniques with maintaining readability, especially in large teams. Do you think the complexity introduced by these optimizations is justified in most production environments, or should they be reserved for specific high-performance use cases?
Absolutely the latter!! Readability translates to maintainability, and that almost always trumps the performance gains, but that highly depends on the use case. There are certainly times when that performance is critical such as virtual real time processes (in most cases, when real physical devices and hardware are involved): e.g. self driving cars, rocket launch control systems, surgery robots, high speed manufacturing lines, etc.
Is the code somewhere available? Would be happy, to read slowly through the whole code, to understand everything. EDIT: found. it will be mentioned in the end of the first minute of the video.
It's lovely to see your daughter agreeing with you at the end of the presentation, but wait until she turns 15 to throw it in your face that you should have used RUST from the beginning. 😂 JK, great presentation, valuable knowledge. Thanks.
Bruh! Why is everyone on the Rust bandwagon? It has its uses but is NOT the be-all-end-all, and surely not a replacement for C#, which is an incredible language.
sure, rust is great. if you have lots and lots of time... time to wait for builds. time to learn it. tme to debug the errors. time to understand the complex data annotations.. but still, I was wondering if he could 've done that csv parser in rust. like proxy pass that part of the app to a rust microservice that does only that..
Thanks! Switching from default UTF-16 C# string to UTF-8 will be the best C# performance improvement (including all string libraries)!
Awesome presentation. I knew some of these concepts already, but the presentation really drives it home!
Awesome presentation. Thanks a lot.
32:55 If I'm not mistaken, that optimization works only for bytes because of unknown endianness of target system where code is going to run. If span element is larger than a byte, a method stub is generated that creates an array instance at runtime and that read-only span points to it. No optimization.
Awesome talk!
5:25 Many people misinterpret what the "measuring" entails. They think that it only means "take the codebase as-is and start benchmarking". Well that's partially true - but only partially. Strictly speaking the biggest part of "measuring" in this phase starts with analyzing from an abstract point of view ("10km above the ground") how "sane" the architecture is to figure out whether the codebase has indeed placed the "horse in front the carriage" from an architectural perspective.
Bad architectures and their absurdities cannot be spotted readily enough by "benchmarking" - you need an architectural mindset first in various domains to really spot bottlenecks. If you start with "benchmarking" you will probably miss out on many important bottlenecks.
"You can't resolve a city-wide traffic jam by benchmarking and laser-focusing on the individual atoms of each and every car-engine involved."
Thank you for making this topic accessible! I appreciate the deep dive into optimizing .NET code, particularly around Span and System.IO.Pipelines. I’m curious about your thoughts on balancing these high-performance techniques with maintaining readability, especially in large teams. Do you think the complexity introduced by these optimizations is justified in most production environments, or should they be reserved for specific high-performance use cases?
Absolutely the latter!! Readability translates to maintainability, and that almost always trumps the performance gains, but that highly depends on the use case. There are certainly times when that performance is critical such as virtual real time processes (in most cases, when real physical devices and hardware are involved): e.g. self driving cars, rocket launch control systems, surgery robots, high speed manufacturing lines, etc.
Thank you Steve!
It is almost always possible to avoid while(true) if () break;, replacing it with while (await src.ReadAsync() is {pattern} piece) { handle(piece);}
Is the code somewhere available? Would be happy, to read slowly through the whole code, to understand everything.
EDIT: found. it will be mentioned in the end of the first minute of the video.
It's lovely to see your daughter agreeing with you at the end of the presentation, but wait until she turns 15 to throw it in your face that you should have used RUST from the beginning. 😂
JK, great presentation, valuable knowledge. Thanks.
Bruh! Why is everyone on the Rust bandwagon? It has its uses but is NOT the be-all-end-all, and surely not a replacement for C#, which is an incredible language.
High performance C# code is an oxymoron. C++ and Rust FTW!
sure, rust is great. if you have lots and lots of time... time to wait for builds. time to learn it. tme to debug the errors. time to understand the complex data annotations..
but still, I was wondering if he could 've done that csv parser in rust. like proxy pass that part of the app to a rust microservice that does only that..
@@DavidSmith-ef4ehI would have used Polars, which is already available, fast as fuck and made in Rust 😂
Turbocharged code has got to be written in Java. Thumbs if you agree or disagree