The Vector in Your CPU: Exploiting SIMD for Superscalar Performance
summary
Claims that single threaded .NET code can get 4x–8x speedups by emitting SIMD instructions at runtime using System.Numerics.Vectors and the RyuJIT in .NET 4.6 on x64. Demonstrates array add and dot product rewrites that replace scalar ops with vector loads, multiplies and stores, shows a refactor for min/max using vector compare and conditional select, and notes limits from instruction latency, missing intrinsics, and memory bandwidth and CPU feature variability.
AI-written summary · about
chapters (15)
- 0:00Introduction to SIMD vectorization
- 1:54Why focus on single-core performance
- 3:18Vector instructions vs parallelization
- 5:03How vector instructions work
- 8:20Evolution of SIMD instruction sets
- 11:13Using Intel Intrinsics Guide
- 12:16Latency and throughput explained
- 14:45SIMD in .NET with System.Numerics
- 18:02Limitations and compatibility
- 19:08Simple vectorization example
- 23:44Vectorizing dot product algorithm
- 28:20Profiling vectorized code
- 29:46Vectorizing algorithms with dependencies
- 36:13Closing thoughts on vectorization
- 39:02Q&A session
