Get the latest tech news
Rust 1.78: Performance Impact of the 128-Bit Memory Alignment Fix
Learn how Rust 1.78 fixed the alignment of 128-bit integers and how we can measure its impact on performance.
Before running the benchmarks, we allocate two arrays of 8192 elements, one filled with StockAlignment instances, and the other one with EnforcedAlignement. This notable performance improvement when using the properly aligned struct confirms our initial idea: optimizing the alignment effectively reduces the number of cache misses and thus RAM accesses, ending up with a positive impact on performance. Those performance changes are not solely due to the alignment fix, but most probably related to optimizations released with the new LLVM version.
Or read this on Hacker News