DMD Performance Regression Publisher [GSoC 2026]
Abul Hossain Khan
abulkhan19175 at gmail.com
Mon Jul 20 16:29:05 UTC 2026
Hi everyone,
Last time I posted update about we Integrated PGO in our Build
process, and the PR was waiting for review. Now the PR is merged
into DMD master.
Here is what we've done since then:
#### Adding Phobos Workload
We added Phobos compilation metrics to perfrunner. We reused the
Phobos checkout already present in CI by passing `--base-phobos`
and `--head-phobos` into perfrunner and compiling Phobos's
`std/package.d` with `-i=std -preview=dip1000`. Measuring Phobos
compilation gives us a much more realistic compiler benchmark (~5
billion instructions and ~633 MB peak RSS) compared to just
compiling a hello world program.
Here is what the bot comment output looks like now with Phobos
included:
| Metric | Base | PR | delta |
|--------|------|----|-------|
| compile hello.d (instr) | 215.6 M | 215.6 M | 0.00% |
| compile hello.d -O (instr) | 234.1 M | 234.1 M | 0.00% |
| compile Phobos (instr) | 5,078.7 M | 5,078.7 M | 0.00% |
| dmd binary size (stripped) | 6.87 MB | 6.87 MB | 0.00% |
| hello binary size | 0.72 MB | 0.72 MB | 0.00% |
| peak RSS (compile hello.d) | 43 MB | 44 MB | +0.33% |
| peak RSS (compile Phobos) | 633 MB | 633 MB | -0.07% |
**PR(Merged)**: https://github.com/dlang/dmd/pull/23432
#### Avoid Spamming
Getting a PR comment about perf every time after opening a PR can
be very annoying, especially when there aren't any significant
deltas. the bot now skips posting if all metric deltas stay
within defined threshold limits. We defined the initial threshold
limits as:
```python
THRESHOLDS = {"cachegrind": 0.1, "stat": 0.1, "time -v": 2.0}
```
Also threshold values need to be determined experimentally over
time by trial and error. So we will observe PRs and can tweak
them accordingly.
Also fixed a small UI issue where zero deltas were showing up as
`-0.00%`. So we add an `abs()` guard for near-zero values, in
comment poster.
**PR(Merged)**: https://github.com/dlang/dmd/pull/23434
#### What's next
- Will see how the bot performs overtime.
- I want to add a couple more real-world workloads, such as
`vibe.d`. If anyone has suggestions for other D libraries/dub
packages we should benchmark, please let me know!
- My mentor gave me an awesome idea that instead of just
displaying raw high-level metrics, we can add stage breakdown
(using `-ftime-trace`). I don't know much about `-ftime-trace`,
so it is going to be very interesting for me to implement it.
Thanks again to Dennis for the guidance and reviews!
And as always, feel free to leave any feedback or suggestions.
More information about the Digitalmars-d
mailing list