Skip to content
0:00 / 0:00

#de-abstraction#.net10#jit

.NET 10 Delegate De-Abstraction

Dissecting The Code

2.3K subscribers • 1 video on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Sergey Teplyakov

Advanced. Deep dive for people who know the field.

5.3K views8 months ago1 recommendation

Systems programmingProgramming languagesPerformance and optimizationCompilers and interpretersC# and .NET

Sergey Teplyakov explains how the .NET 10 JIT compiler uses de-abstraction to eliminate the performance and allocation costs of delegates.

.NET 10 has a lot of different features focused on improving performance and productivity. And one of the most important one is de-abstraction that gives JIT an ability to almost completely remove the abstraction cost when using interfaces and delegates. ▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬ GITHUB - github.com/SergeyTeplyakov X/TWITTER - x.com/steplyakov LINKEDIN - linkedin.com/in/sergeyteplyakov BLOG - sergeyteplyakov.github.io/Blog ▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬ - Intro - What are the delegates? - Different types delegates - The delegates under the hood - Profiling the allocations - Spanification - The JIT output - Conclusion 👇 Drop your topic suggestions in the comments and let’s keep dissecting together. #dotnet #csharp #dotnet10 #performance #deabstraction

Why it's here

1 person recommends this

What people say. Recommended as a great explanation of the new zero-cost delegate optimizations in .NET 10.

u/GOPbIHbI4in r/dotnet • Recommends

Zero cost delegates in .NET 10 The delegates are essentially the glorified callbacks, and historically the JIT was not been able to do the right thing to reduce the cost of using them. This has changed in .NET 10 with de-abstraction initiative. De-abstraction had two main focuses: de-abstracting the interface calls (which led to huge performance gains on stuff like enumeration over lists via IEnumerable interface), and de-abstracting the delegates. When the JIT sees that the delegate doesn’t escape it can stack allocate it. Which means that in some cases the LINQ operation that was allocating 64 bytes now would have 0 allocations (this is the case when the lambda captures only the instan…