Mehdi Akiki

Posts tagged "compiler-internals"

  • Published on
    A 16-line program without unsafe reads a String after it is dropped. Every Rust on my laptop accepts it, and variants compile back to Rust 1.4 from 2015. I looked at the dead memory with gdb and AddressSanitizer, and found the check that the borrow checker skips.
  • Published on

    Investigation · Part 17 of 20 · When the benchmark lies

    Why Sorted Data Can Make the Same Loop Faster

    The famous result says that a loop over sorted data is faster because of branch prediction. In my Rust version, sorting changed nothing, because the compiler removed the branch. With a branch that it could not remove, random data was 3 to 10 times slower.
  • Published on
    Rust 1.97 made v0 symbol mangling the stable default. Compare real nm output, read the encoding, and know what changes for profilers, debuggers, and ABI boundaries.