Descriptiontextproto: string interning on headers to reduce allocations
Saving one allocation per header for common HTTP
headers results in more transactions/GC in a
webserver and a lower "GC tax" per transaction,
and a higher throughput.
benchmark old ns/op new ns/op delta
BenchmarkReadMIMEHeader 12811 13240 +3.35%
benchmark old allocs new allocs pct new/old
BenchmarkReadMIMEHeader 32.00 24.00 75.00
Timings are noisy; worst case in 5 trials above; the average
is 0% time delta.
Also, updated benchcmp to show alloc savings.
Patch Set 1 #Patch Set 2 : diff -r 8e69b6243f49 https://code.google.com/p/go #Patch Set 3 : diff -r 8e69b6243f49 https://code.google.com/p/go #Patch Set 4 : diff -r 8e69b6243f49 https://code.google.com/p/go #
Total comments: 1
MessagesTotal messages: 6
|