Local performance measurements
These are local maintainer measurements produced by scripts/benchmark.py, not universal performance guarantees. They use the system GCC offline so the numbers measure CLAP/Ninja orchestration rather than a first-time toolchain download.
- recorded:
2026-12-02T23:50:20.269174+00:00 - machine:
Linux 6.8.0-1060-aws x86_64, Python3.10.12, CPUs8 - compiler:
gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0 - repetitions per scenario:
3
| Scenario | Median | Min | Max | Meaning |
|---|---|---|---|---|
raw-compiler-cold | 0.032s | 0.031s | 0.033s | one direct GCC compile/link invocation without CLAP |
direct-cold | 0.098s | 0.098s | 0.099s | first CLAP build of a fresh two-source direct project |
direct-noop | 0.074s | 0.072s | 0.075s | unchanged Ninja rebuild check |
direct-incremental | 0.100s | 0.098s | 0.113s | rebuild after changing a shared header |
parallel-j1 | 0.418s | 0.416s | 0.428s | first Ninja build of 33 independent translation units with one job |
parallel-j4 | 0.181s | 0.181s | 0.184s | first Ninja build of 33 independent translation units with four jobs |
coverage-report | 0.105s | 0.105s | 0.105s | instrumented run plus gcov summary generation |
raw-cmake-cold | 0.228s | 0.227s | 0.229s | raw CMake configure plus Ninja build without CLAP |
clap-cmake-cold | 0.227s | 0.227s | 0.228s | CLAP configure plus build of the same fresh CMake project |
cmake-object-cache-cold | 1.075s | 1.070s | 1.087s | first optimized CLAP CMake configure/build of a heavy project with object caching enabled |
cmake-object-cache-hit | 0.252s | 0.251s | 0.267s | clean optimized CLAP CMake configure/build of a heavy project after deleting the build directory with matching cached objects |
object-cache-cold | 0.877s | 0.862s | 0.883s | first opt-in object-cache build of an optimization-heavy project |
object-cache-hit-small | 0.088s | 0.087s | 0.090s | clean rebuild of a small two-source project with matching cached objects |
object-cache-hit | 0.088s | 0.088s | 0.089s | clean rebuild of the same heavy project with matching cached objects |
How to read the comparisons:
raw-compiler-coldis only the compiler driver invocation.direct-coldadditionally includes Python startup, project/config discovery, Ninja file generation, dependency-file setup, JSON result construction, and CLAP's incremental-build bookkeeping.raw-cmake-coldandclap-cmake-coldboth configure and build the same CMake project with Ninja. CLAP additionally performs compiler discovery/probing setup, exports compile commands, and emits structured metadata; small median differences at this scale should be treated as noise unless they persist across machines.- The object-cache comparison is the meaningful scaling signal: a heavy clean rebuild with matching cached objects is close to the small-project cache-hit cost instead of the heavy cold-compile cost. A cache hit still pays Python/Ninja startup, dependency validation, object restoration, and linking because the output binary is absent; therefore it should not be compared with a no-op rebuild.
- For the heavy CMake project, deleting the build directory drops the measured median from the cold object-cache configure/build cost to roughly the configure-plus-cache-hit cost; CMake configure still dominates the small hit case, but the heavy compile work is avoided.
parallel-j1versusparallel-j4measures Ninja compile scheduling over 33 independent translation units. It is a scaling measurement, not a promised linear speedup; link time, Python startup, and machine load bound the result.
Scaling spot-check: 121 translation units
Recorded 2026-12-03 on the same machine with the pinned private Zig toolchain, generated project of 120 interdependent modules plus a main file:
| Measurement | Wall time | Meaning |
|---|---|---|
| cold parallel build | 0.505s | first build of all 121 translation units |
| no-op rebuild | 0.096s | unchanged rebuild check |
| single-source change | 0.144s | rebuild after touching one module; object cache restores unaffected objects |
These are orchestration-cost measurements on small translation units — real-world compile time is dominated by source size, not file count. They show that Ninja parallelism plus the object cache keep the per-file fixed cost low enough that adding files is cheap.
Real-world compile times
Same machine, pinned toolchain, --profile release:
| Project | Size | Cold build time |
|---|---|---|
| SQLite 3.50.4 amalgamation + shell | ~260k lines in 2 TUs | 17.7s |
| Lua 5.4.8 interpreter | 34 TUs | 4.1s |
Both produce working binaries (verified by running SQL queries / Lua scripts); see REAL_WORLD_BUILDS.md.
Per-edge timing diagnostics
clap build --timing still reports the coarse toolchain/compile/run/total phases. For direct Ninja builds, JSON output additionally contains timing_steps: compile/link/archive edges whose Ninja log entries were refreshed by that invocation. Each step includes the raw Ninja output, resolved target, kind, start/end offsets in milliseconds, duration, and source when an object can be mapped back to an input source file. A no-op rebuild has an empty list; that is intentional and means Ninja found no work to do.
These edge timings are diagnostic data, not a CPU profiler. Parallel compile edges can overlap, very small edges are rounded to millisecond resolution by Ninja, and non-Ninja/CMake builds currently expose only the coarser phase timings.
Refresh this file with:
python scripts/benchmark.py --format markdown --output docs/PERFORMANCE.md