Closed VojtechVitek closed 3 months ago
goos: linux
goarch: amd64
pkg: github.com/go-chi/httprate
cpu: AMD EPYC 7763 64-Core Processor
│ master.txt │ pr.txt │
│ sec/op │ sec/op vs base │
LocalCounter-4 19.33m ± 1% 19.55m ± 1% +1.13% (p=0.000 n=10)
│ master.txt │ pr.txt │
│ B/op │ B/op vs base │
LocalCounter-4 2.834Mi ± 0% 2.834Mi ± 0% ~ (p=0.481 n=10)
│ master.txt │ pr.txt │
│ allocs/op │ allocs/op vs base │
LocalCounter-4 121.5k ± 0% 121.5k ± 0% ~ (p=0.541 n=10)
The in-memory counter doesn't require time window to be hashed anymore, since we started using two sliding counter hash maps instead of a single hash map.