Descriptiongo.crypto/ssh: reuse buffer during WriteExtended
It was pointed out on golang-nuts that WriteExtended allocates a large buffer for every call to writePacket. This can be optimised a little without going to the extent of setting up a buffer pool.
We don't have great benchmarks of this, but initial tests show
benchmark old ns/op new ns/op delta
BenchmarkEndToEnd 12417961 12004715 -3.33%
BenchmarkMarshalKexInitMsg 10251 10472 +2.16%
BenchmarkUnmarshalKexInitMsg 22723 22225 -2.19%
BenchmarkMarshalKexDHInitMsg 1301 1285 -1.23%
BenchmarkUnmarshalKexDHInitMsg 717 745 +3.91%
benchmark old MB/s new MB/s speedup
BenchmarkEndToEnd 84.44 87.64 1.04x
benchmark old allocs new allocs delta
BenchmarkEndToEnd 107 75 -29.91%
benchmark old bytes new bytes delta
BenchmarkEndToEnd 2616693 1346890 -48.53%
Patch Set 1 #Patch Set 2 : diff -r 00a7d3b31bbab5795b4a51933c04fc2768242970 https://code.google.com/p/go.crypto #Patch Set 3 : diff -r 00a7d3b31bbab5795b4a51933c04fc2768242970 https://code.google.com/p/go.crypto #
Total comments: 3
MessagesTotal messages: 5
|
||||||||||||||||||||||||||||