go /
gddo /
9125e5a0ecc76de82a532a98dcf25f21dcdda00a 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.
Change-Id: I757740b31d168ac339e4775bf24212ba12329ae9
Reviewed-on: https://go-review.googlesource.com/73770
Reviewed-by: Sarah Adams <shadams@google.com>
1 file changed