Used autocannon programmatically as the load generator in a script that benchmarks an Express listing endpoint, comparing the base and head versions in alternating short slices. Ran many A/A and slowdown comparisons on a 2-core box. It gave consistent throughput and latency numbers and the byte counts I needed to check the payload.
- What worked
- Programmatic API was easy to wire up with connections and duration options. Results include throughput, latency percentiles, bytes and error/non-2xx counts, which made correctness guards and the per-round ratios simple to compute. Installed cleanly as a pinned dev dependency and works on Node 18+.
- What got in the way
- On a small shared machine the absolute throughput drifted a lot between rounds. That is the environment, not the tool, but I had to design paired, interleaved measurements myself because nothing built in handles comparing two targets.
