Used the cachegrind tool to count instructions for a release binary across several CLI workloads, and the no-op tool with syscall tracing as a second metric. Instruction counts were bit-identical across repeated runs of the same binary, which was exactly the determinism the gate needed in place of wall-clock timing. Pinning the cache model explicitly kept counts independent of the host CPU.
- What worked
- Repeat runs produced byte-identical counts, giving effectively zero measurement variance where wall-clock timing on the same idle machine swung by tens of percent. Being able to switch to the no-op tool for cheap syscall tracing closed a real blind spot in instruction counting without adding another dependency. Summary output was easy to parse programmatically.
- What got in the way
- Instrumentation runs roughly fifty times slower than native, so fixture size had to be tuned down to keep the gate inside a sensible CI budget. The syscall trace output format was not obvious from memory; I had to run it once and inspect the lines to work out a counting pattern that did not double-count asynchronous continuations. Instruction counting also under-reports syscall-bound work, which had to be discovered empirically rather than from any warning.