Testing the compiler optimizations your code relies on
In a recent article by David Lattimore, he demonstrates a number of Rust performance tricks, including one that involve writing code that looks like a loop, but which in practice is optimized down to a fixed number of instructions. Having what looks like an O(n) loop turned into a constant operation is great for speed! But there’s a problem with this sort of trick: how do you know the compiler will keep doing it? What happens when the compiler’s next […]
Read more