Real-world examples on optimizing .NET performance - Stefán Jökull Sigurðarson - NDC Oslo 2023
HTML-код
- Опубликовано: 16 июн 2024
- In this session I will show you real-world examples of code and techniques used to improve the performance of the RabbitMQ .NET Client, a .NuGet package with over forty-nine million downloads on NuGet. You will learn about memory allocations and their impact on the garbage collector and performance optimization techniques. You will get to know .NET language features like ref structs and ref parameters, code inlining, .NET constructs like Span T, Memory T, ArrayPool and even some unsafe code. There will be benchmarks and real code that you can apply to your own solutions and, who knows, you might even catch the occasional glimpse of some assembly code!
Check out our new channel:
NDC Clips:
@ndcclips
Check out more of our featured speakers and talks at
ndcconferences.com/
ndcoslo.com/ - Наука
Maybe the best NDC talk AND THEY FILMED IT IN A HALLWAY
why is there so much crowd noise in the background?
Honestly, never heard of Channels and saw so many optimizations. Well done 👍
00:00 Intro
01:20 Garbage collectio
03:58 Reference vs. Value types
05:16 Performance tips
ArrayPool doesn't have a reference to the array after rent, so not returning array to the pool mitigates the point of using ArrayPools but isn't dangerous - do not lead to memory leaks. You don't need to be orthodox and write some finalizers to be extremally sure that array will return to the pool on some edge cases (like exceptions).
Thanks for the correction. I had overlooked this :)
Was this filmed in the middle of a busy cafeteria?
Who does the audio for tech conferences?
"But if it was to be run on different architectures... (fluke boom in audience) ... it would fail" made me lol 28:02
Isn't Channels same as the "new" Pipe API?
Channels are made for asynchronous producer-consumer scenarios and they are generic, for any type T. The new pipe API works with raw bytes and provides automatic memory buffer management via memory pooling.
@@gdargdar91
But also Pipes have async producer/consumer pattern, there is two types of pipe, `IPipeReader` and `IPipeWriter`
Its about time the working of the garbage collector is considered important instead of treated like a black box. .NET game devs take note, the GC isnt optimized for your use case, so you have to take control and do regular collection manually (GC.Collect(..) )
Eye opening conference, too bad the noise and claps distract it.
Performance and .NET in the same sentence...
I see you must have been living in a cave since the last couple .Net Core release iterations