[all-commits] [llvm/llvm-project] 0c27a6: [libc++] Lower the default benchmark_min_time to 0...

Louis Dionne via All-commits all-commits at lists.llvm.org
Fri Aug 7 05:48:00 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c27a66627a5077c52e549dae787294c4570d4d0
      https://github.com/llvm/llvm-project/commit/0c27a66627a5077c52e549dae787294c4570d4d0
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    M .github/workflows/libcxx-pr-benchmark.yml
    M libcxx/utils/libcxx/test/format.py
    M libcxx/utils/libcxx/test/params.py

  Log Message:
  -----------
  [libc++] Lower the default benchmark_min_time to 0.2s (#214499)

We were using GoogleBenchmark's default benchmark_min_time of 0.5s,
which makes the benchmark suite slow to run for little benefit. This
patch adds a benchmark_min_time Lit parameter and defaults it to 0.2s,
which runs the suite over 2x faster. It also bumps the PR benchmark job
from median-of-3 to median-of-5 to make up for the slightly noisier
samples.

To pick the value of 0.2s, every benchmark in the suite was run at 0.5s
and 0.2s back-to-back, 5 times. Over the whole benchmark suite:

```
              median CV    p90      p99
  0.5s          0.40%     2.34%   16.93%
  0.2s          0.53%     2.45%   17.03%
```

So while 0.2s is noisier, the noise increase sits mostly in the body of
the distribution instead of the tail. The tail of noisier benchmarks is
where the noise is already a problem for detecting regressions, but this
change doesn't have a large impact on that. I think that addressing
those noisy benchmarks directly (by e.g. rewriting or finding
alternative ways to benchmark the same thing) would be more effective.

Also, making it faster to run the benchmarks means that we can gather
more samples (i.e. do more "independent" runs on each commit), which
should reduce the noise more significantly than just running each
benchmark for longer.

Also note that going below 0.2s is not a clear win. Indeed, the speed
gain we obtain is not linear, since some benchmarks go past the
specified min time anyway, and the setup time still exists.

Assisted by Claude for the measurements and reasoning that led to
choosing 0.2s over other values.

Fixes #214055



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list