Loop alignment and performance stability in .NET 6
summary
Teams run thousands of microbenchmarks daily and find noisy regressions; investigation shows loop start alignment drives instability, so .NET 6 adds automatic alignment of loops that pads hot innermost loops to a boundary (prefers 32-byte adaptive alignment with fallbacks to 16 bytes), aligns only small/fast loops and hides padding where possible. Tooling uses super PMI and benchmark.net traces to flag 150–250 affected benchmarks; results show reduced noise and measurable speedups.
AI-written summary · about
chapters (9)
- 0:00Introduction and context
- 10:24Computer architecture basics
- 17:48Loop alignment in .NET 6
- 25:16Adaptive loop alignment
- 31:35Impact and benchmarks
- 36:57Future plans in .NET 7
- 37:18Data alignment challenges
- 40:52Tooling improvements
- 43:40Call to action
related talks
56mState of the .NET Performance
01h 04mWhat is new in .NET 6 and the future of .NET
37mRock Your Code Code and App Performance for Microsoft .Net
47mUnlocking Performance Improvements in .NET
47mSolving .NET performance issues
52mPerformance features in C#
43mPragmatic Performance: When to care about perf, and what to do about it.
46mDeep dive into .NET performance and native AOT
