Add baseline compile benchmark results

This commit is contained in:
Magne Sjaastad committed 2026-04-08 12:37:36 +02:00
1 parent ab97381d94
commit 700549fb3b
1 file changed
+24 -16
@@ -4,38 +4,46 @@
| Setting | Value |
|---|---|
| Branch | `pdm-compile-bench` |
| Commit | `c7ec12fba` |
| Compiler | MSVC (cl.exe) |
| Build system | Ninja |
| Parallelism | 20 cores |
| Parallelism | 2 cores |
| buildcache | disabled |
| Precompiled headers | disabled |
| Unity build | disabled |
| Date | 2026-04-06 |
The benchmark target is an `OBJECT` library with `UNITY_BUILD OFF`, so each
translation unit is compiled in isolation. Times are wall-clock milliseconds
read from `.ninja_log` (`finish_time - start_time`).
read from `.ninja_log` (`finish_time - start_time`). Each run is a full clean
rebuild (`ninja -t clean cafPdm_CompileBench` followed by rebuild).
## Raw Results (ms)
| File | Run 1 | Run 2 | Run 3 | **Avg** |
|---|---|---|---|---|
| bench_filepath_fields.cpp | 2352 | 2278 | 2370 | **2333** |
| bench_basic_fields.cpp | 2594 | 2544 | 2603 | **2580** |
| bench_container_fields.cpp | 2749 | 2686 | 2805 | **2747** |
| bench_enum_fields.cpp | 3835 | 3703 | 3785 | **3774** |
| bench_mixed_fields.cpp | 4497 | 4323 | 4554 | **4458** |
## Baseline — 2 cores, 3 runs — branch `pdm-compile-bench-01`, commit `e5577fda8` (2026-04-06)
| File | Run 1 | Run 2 | Run 3 | **Avg** | **Delta vs baseline (20 cores)** |
|---|---|---|---|---|---|
| bench_filepath_fields.cpp | 2239 | 2253 | 2258 | **2250** | -45 |
| bench_basic_fields.cpp | 2364 | 2399 | 2370 | **2378** | -142 |
| bench_container_fields.cpp | 2647 | 2669 | 2634 | **2650** | -123 |
| bench_enum_fields.cpp | 3389 | 3460 | 3380 | **3410** | -341 |
| bench_mixed_fields.cpp | 3938 | 4045 | 3978 | **3987** | -422 |
## After changes — 2 cores, 3 runs — branch `pdm-compile-bench-01`, commit `e5577fda8` + stash applied (2026-04-06)
| File | Run 1 | Run 2 | Run 3 | **Avg** | **Delta vs baseline (2 cores)** |
|---|---|---|---|---|---|
| bench_filepath_fields.cpp | 2229 | 2170 | 2158 | **2186** | -64 |
| bench_basic_fields.cpp | 2324 | 2342 | 2318 | **2328** | -50 |
| bench_container_fields.cpp | 2555 | 2601 | 2557 | **2571** | -79 |
| bench_enum_fields.cpp | 3284 | 3291 | 3316 | **3297** | -113 |
| bench_mixed_fields.cpp | 3886 | 3876 | 3898 | **3887** | -100 |
## Notes
- Each run was a full clean rebuild (`ninja -t clean cafPdm_CompileBench` followed by rebuild).
- The benchmark files exercise different combinations of PDM field types:
- `bench_filepath_fields` — `caf::FilePath` fields
- `bench_basic_fields` — primitive field types (`int`, `double`, `bool`, `QString`)
- `bench_container_fields` — `std::vector` container fields
- `bench_enum_fields` — enum fields with `AppEnum`
- `bench_mixed_fields` — mix of all field types
- `bench_mixed_fields` is the heaviest translation unit (~4458 ms avg) and is the
most representative proxy for a real PDM object with diverse field usage.
- `bench_mixed_fields` is the heaviest translation unit and is the most
representative proxy for a real PDM object with diverse field usage.