Mehdi Akiki

Posts tagged "rust"

  • Published on

    Investigation · Part 8 of 20 · When the benchmark lies

    The Average Hides the Slow Requests

    I timed four million single Vec::push calls: mean 22.8 ns, slowest 315,684 ns. The slow ones were not the reallocations but page faults, and huge pages made them bigger. Then a simulated request handler where the mean is a time that no request had.
  • Published on

    Investigation · Part 7 of 20 · From source to a running process

    How the Dynamic Loader Finds a Shared Library

    I built a small shared library and a program that needs it, got the famous cannot open shared object file, and fixed it three ways while LD_DEBUG=libs showed every directory the loader tried, including why RPATH and RUNPATH give different answers.
  • Published on
    Rust's Aho–Corasick crate can build three different automata. I compare their construction cost, memory layout, search behavior, and the evidence needed before forcing one.
  • Published on

    Investigation · Part 6 of 20 · When the benchmark lies

    My Laptop Changed Its CPU Speed During the Benchmark

    I measured the work of one loop and the clock of its core at the same time, for one minute. The clock moved between 3.3 and 4.2 GHz without any change in my program, and the work per cycle stayed the same in every phase. Here is the trace, and what I can do about it on a laptop.
  • Published on
    A span comparison harness showing why generated Rust errors point at the macro invocation, how to preserve input spans, and how to test diagnostics with compile-fail fixtures.