internal/requestlog: add end-to-end benchmarks
Results from my workstation:
BenchmarkE2E/Baseline-12 20000 85744 ns/op 5171 B/op 68 allocs/op
BenchmarkE2E/WithLog-12 20000 98693 ns/op 6321 B/op 102 allocs/op
We can expect ~10us CPU and ~1KB RAM of overhead per each request.
Likely fluentd will be the bottleneck at that point.
I dug in with the profiler and the overhead is almost entirely coming
from JSON encoding. If performances becomes an issue, use of the
encoding/json package could be eschewed for a custom marshaler.
Reviewed-by: Sarah Adams <email@example.com>
1 file changed