Descriptionnet/http, net/textproto: cache common header values
We use a small, automatically updated cache of recently
seen values in order to avoid allocations for values
like "keep-alive" and "close".
benchmark old ns/op new ns/op delta
BenchmarkHeaderWriteSubset 2215 2284 +3.12%
BenchmarkClientServer 360168 382181 +6.11%
BenchmarkClientServerParallel4 382254 371981 -2.69%
BenchmarkClientServerParallel64 319201 304283 -4.67%
BenchmarkServer 336708 327858 -2.63%
benchmark old allocs new allocs delta
BenchmarkHeaderWriteSubset 2 2 0.00%
BenchmarkClientServer 114 105 -7.89%
BenchmarkClientServerParallel4 114 105 -7.89%
BenchmarkClientServerParallel64 115 106 -7.83%
BenchmarkServer 36 32 -11.11%
Benchmarks in net/textproto:
benchmark old ns/op new ns/op delta
BenchmarkReadMIMEHeader 11302 10785 -4.57%
BenchmarkUncommon 1851 1777 -4.00%
benchmark old allocs new allocs delta
BenchmarkReadMIMEHeader 25 19 -24.00%
BenchmarkUncommon 5 4 -20.00%
Patch Set 1 #Patch Set 2 : diff -r 4d72f3689b54 https://code.google.com/p/go #
Total comments: 16
Patch Set 3 : diff -r 591fc8a0131a https://code.google.com/p/go #
Total comments: 3
Patch Set 4 : diff -r 591fc8a0131a https://code.google.com/p/go #Patch Set 5 : diff -r 591fc8a0131a https://code.google.com/p/go #Patch Set 6 : diff -r 591fc8a0131a https://code.google.com/p/go #
Total comments: 2
MessagesTotal messages: 12
|