Mehdi Akiki

Posts tagged "rust"

  • Published on

    Investigation · Part 4 of 20 · When the benchmark lies

    Why the First Run Is Slower

    The first iteration of my loop took 145 microseconds and the steady state 12. I separated the causes I could show on my laptop: page faults, cold caches, a pause of 300 ms, lazy binding in C, and the start of the process itself.
  • Published on

    Article · Interrupted execution

    Cancellation Safety in Async Rust, Explained

    Async cancellation usually means dropping a future after Pending. See how select loops lose partial progress and how to design restartable operations.
  • Published on

    Article · Through the layers

    Why a Rust Future Is Not Send Across .await

    A Rust future is Send only when every stored state is safe to move across threads. Trace captures and locals across await to fix spawn errors.
  • Published on

    Investigation · Part 3 of 20 · When the benchmark lies

    When the Compiler Computes the Answer Before the Benchmark Runs

    On my laptop, summing the numbers below one thousand takes 0.81 ns, and below one billion also 0.81 ns. black_box hid the value of n, but LLVM replaced the loop with a formula. I show the assembly, the IR, the LLVM pass, and a benchmark that really grows with n.
  • Published on
    Zero-copy scanning still reads every inspected byte. It removes a second materialization in memory. I use streaming Aho-Corasick to explain automaton state, chunk boundaries, DFA dependency chains, prefilters, and honest performance measurement.