Mehdi Akiki

Posts tagged "when the benchmark lies"

  • Published on

    Investigation · Part 10 of 20 · When the benchmark lies

    Which Clock to Use When You Measure Time

    I measured eight of the clocks that clock_gettime can read, and on my laptop two of them disagreed by 43,257 ns after 20 seconds. I measured their resolution, their cost, which ones enter the kernel, and which clocks Rust and Python use.
  • Published on

    Investigation · Part 9 of 20 · When the benchmark lies

    Coordinated Omission: How a Load Test Hides Its Worst Latency

    My toy server stops for half a second every five seconds. A client that waits for each answer saw 4 slow requests out of 1.36 million, and a p99 of 30 microseconds. A client with a fixed schedule saw 1,608 slow requests and a p99 of 450 milliseconds.
  • 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 · When the benchmark lies

    The Benchmark Ran on an Efficiency Core

    On a laptop with two kinds of cores, I measured the same benchmark on a P-core and on an E-core, without taskset, and with two threads on one core. The E-core needed more cycles, not only a lower clock, and a busy sibling thread made a P-core as slow as an E-core.
  • 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.