Performance
Benchmarks
Section titled “Benchmarks”Measured on an Intel Core i5-11300H @ 3.10 GHz.
| Benchmark | Latency per call | Allocations |
|---|---|---|
RollingPercentile.Update() | ~65 ns | 0 allocs / 0 B |
Execute(), Closed (full pipeline) | ~656 ns | 0 allocs / 0 B |
Execute(), Open (fast reject) | ~57 ns | 0 allocs / 0 B |
Complexity
Section titled “Complexity”n is Config.WindowSize (100 by default).
| Component | Time | Space |
|---|---|---|
| EWMA update | O(1) | O(1) |
| Rolling percentile update | O(n) | O(n), zero allocation |
| Rolling percentile read | O(1) | O(1) |
| Threshold calculation | O(1) | O(1) |
Execute() total overhead | O(n) per call | O(n) |
The O(n) update is a single in-place pass over a small fixed window, which is why the full pipeline stays below a microsecond.
Reproducing
Section titled “Reproducing”The library ships Go benchmarks:
go test -bench . -benchmem ./...The evaluation additionally measures container CPU and memory under load for two hardware profiles; see Metrics.