ferris-perf
Installation
SKILL.md
Performance Measurement
Measure the right build
- Profile optimized builds with symbols. Cargo: a
[profile.profiling]thatinherits = "release"withdebug = true(or"line-tables-only"). MSVC:/Ziand/DEBUG, but/DEBUGswitches the linker to/OPT:NOREF,/OPT:NOICF, and incremental linking; restore/OPT:REF /OPT:ICF /INCREMENTAL:NOso the measured binary matches the shipped one. - Keep hardening (
/guard:cf,/CETCOMPAT, overflow checks the project enables) on while measuring; removing it is not an optimization. -C target-cpu=nativeand/arch:levels above the deployment baseline produce binaries that fault on older CPUs. Use them only for binaries that never leave the build machine.
Get a trustworthy number
- Fix the workload and the metric (p50/p99 latency, throughput, peak private bytes, build time) before changing code.
- Interleave runs (A B A B) and report median and spread over repeated runs on the same machine. Discard or report the cold first run separately.
- Defender real-time scanning, indexing, power plan, and thermal limits dominate I/O and build timings on Windows. Note them; changing exclusions, power plans, or Dev Drive setup is a machine-wide change that needs approval.
- In microbenchmarks, keep inputs and results opaque to the optimizer (
std::hint::black_box,benchmark::DoNotOptimize). Confirm a microbenchmark win at the user-visible metric.