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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Rust

Rust

Photo of performance impact

performance impact

Related news:

News photo

Exercises to Learn Rust

News photo

Some notes on Rust, mutable aliasing and formal verification

News photo

Translation of Rust's core and alloc crates to Coq for formal verification