Mehdi Akiki

Posts tagged "performance"

  • Published on

    Investigation · Part 19 of 20 · When the benchmark lies

    The Microbenchmark Won and the Program Got Slower

    Alone, a lookup table was four times faster than a division. In a loop that also used 1 to 8 MiB of its own counters, the same table made the whole loop 4 to 34 percent slower. The microbenchmark had the cache for itself, and the program had to share it.
  • 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
    A scanner can inspect bytes efficiently and still drown in valid results. I explain output-sensitive cost, overlapping matches, allocations, callbacks, and bounded consumers in Rust.
  • Published on
    A rustc self-profile records compiler activities and query events. First isolate the slow crate, then compare self time, invocation count, cache behaviour, and code generation under controlled builds.