coredns / rrl

Response Rate Limiting Plugin for CoreDNS
Apache License 2.0
23 stars 21 forks source link

enhance benchmark #16

Closed rdrozhdzh closed 5 years ago

rdrozhdzh commented 5 years ago
rdrozhdzh commented 5 years ago

On my machine I have got output like below

$ go test -benchmem -bench .
goos: linux
goarch: amd64
pkg: github.com/coredns/rrl/plugins/rrl
BenchmarkBuildToken-4        5000000           340 ns/op          72 B/op          5 allocs/op
BenchmarkDebit-4             3000000           509 ns/op         120 B/op          5 allocs/op
BenchmarkServeDNS/with-rrl-4              500000          2826 ns/op         725 B/op         30 allocs/op
BenchmarkServeDNS/without-rrl-4         10000000           181 ns/op         177 B/op          3 allocs/op
PASS
ok      github.com/coredns/rrl/plugins/rrl  9.601s