Day 15 of Advent of Compiler Optimisations!
Two nearly identical loops: one accumulates ints into an int, the other accumulates ints into a long. You'd expect similar assembly—just different register sizes, right? Wrong! One loop writes to memory on every iteration, the other keeps everything in registers. Same algorithm, wildly different performance. What's going on?
Read more: https://xania.org/202512/15-aliasing-in-general
Watch: https://youtu.be/PPJtJzT2U04