Mehdi Akiki

Posts tagged "compiler-internals"

  • Published on

    Article · Through the layers

    Why Rust Async Futures Get So Large

    Rust async functions store every value needed after an await. Learn to measure future size, identify saved fields, and reduce it without boxing everything.
  • Published on

    Investigation · Part 2 of 20 · When the benchmark lies

    A Debug Build Measures a Different Program

    A test called score_is_fast measured 44,646 ns per call under cargo test and 1,136 ns with --release, one run each. I compare four optimization levels in Rust and two in C, and I show in the assembly what a debug build really measures.
  • Published on

    Investigation · Part 1 of 20 · When the benchmark lies

    The Benchmark That Measured Nothing

    My first benchmark said that my laptop adds 4,096 numbers in 0.00005 nanoseconds. The compiler had deleted the loop. I show it in the assembly, fix it with black_box, make the same mistake in C, and explain the method of this series.