mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-08-11 04:41:23 +00:00
The existing test_benchmark asserts a single request completes within 5ms, which catches gross connection-setup regressions but cannot see throughput changes: the effects we care about are tens of microseconds per request, a hundredth of that resolution. There was no way to answer "does this patch make the server faster" other than measuring by hand. Absolute req/s is not usable for that. Running the same binary five times on an idle 8-core machine gave 53.9k to 74.6k req/s, and shared CI runners are noisier still, so a number printed per push says nothing. Build both refs and measure them alternately in one session, flipping the order each round to cancel ordering bias, then report only the ratio of the medians. Whether that ratio means anything is decided by an exact permutation test rather than by comparing the change against the min/max spread - a single slow round is enough to make a spread check give up, while the rank test rides it out. Validated against a patch that removes a redundant poll() per request: individual measurements ranged 41.7k-93.9k req/s, yet nine rounds resolved a 1.244x speedup at p = 0.019. The same data truncated to five rounds was inconclusive, so the workflow defaults to nine. Manual dispatch only, Linux and non-SSL for now, and it never fails the build - this is a measurement, not a test.
1.4 KiB
1.4 KiB