Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(93)

Issue 5728053: code review 5728053: go.crypto/ssh: improve marshal performance (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by dave
Modified:
13 years ago
Reviewers:
CC:
agl1, minux1, remyoudompheng, golang-dev
Visibility:
Public.

Description

go.crypto/ssh: improve marshal performance Atom N450, 6g benchmark old ns/op new ns/op delta BenchmarkMarshalKexInitMsg 96446 66675 -30.87% BenchmarkUnmarshalKexInitMsg 155341 142715 -8.13% BenchmarkMarshalKexDHInitMsg 9499 8340 -12.20% BenchmarkUnmarshalKexDHInitMsg 4973 5145 +3.46% Intel E3-1270, 6g benchmark old ns/op new ns/op delta BenchmarkMarshalKexInitMsg 23218 16903 -27.20% BenchmarkUnmarshalKexInitMsg 31384 31640 +0.82% BenchmarkMarshalKexDHInitMsg 1943 1661 -14.51% BenchmarkUnmarshalKexDHInitMsg 915 941 +2.84%

Patch Set 1 #

Patch Set 2 : diff -r 91ccd0bd392e https://code.google.com/p/go.crypto #

Patch Set 3 : diff -r 91ccd0bd392e https://code.google.com/p/go.crypto #

Total comments: 8

Patch Set 4 : diff -r 91ccd0bd392e https://code.google.com/p/go.crypto #

Patch Set 5 : diff -r 861daa0e6913 https://code.google.com/p/go.crypto #

Patch Set 6 : diff -r 861daa0e6913 https://code.google.com/p/go.crypto #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -76 lines) Patch
M ssh/common.go View 1 1 chunk +18 lines, -0 lines 2 comments Download
M ssh/messages.go View 1 2 3 6 chunks +34 lines, -76 lines 0 comments Download

Messages

Total messages: 7
dave_cheney.net
Hello agl@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.crypto
13 years, 1 month ago (2012-03-03 09:28:15 UTC) #1
minux1
http://codereview.appspot.com/5728053/diff/4001/ssh/common.go File ssh/common.go (right): http://codereview.appspot.com/5728053/diff/4001/ssh/common.go#newcode260 ssh/common.go:260: *b = append((*b), byte(n>>8), byte(n)) Why not instead wrap ...
13 years, 1 month ago (2012-03-03 09:40:29 UTC) #2
remyoudompheng
http://codereview.appspot.com/5728053/diff/4001/ssh/messages.go File ssh/messages.go (right): http://codereview.appspot.com/5728053/diff/4001/ssh/messages.go#newcode313 ssh/messages.go:313: case reflect.Uint8: isn't it a []byte in most cases? ...
13 years, 1 month ago (2012-03-03 09:45:17 UTC) #3
dave_cheney.net
Hello agl@golang.org, minux.ma@gmail.com, remyoudompheng@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 1 month ago (2012-03-03 10:50:47 UTC) #4
dave_cheney.net
Thanks for the quick replies. Please take another look. http://codereview.appspot.com/5728053/diff/4001/ssh/common.go File ssh/common.go (right): http://codereview.appspot.com/5728053/diff/4001/ssh/common.go#newcode260 ssh/common.go:260: ...
13 years, 1 month ago (2012-03-03 10:51:11 UTC) #5
agl1
*** Submitted as http://code.google.com/p/go/source/detail?r=b87c16c531f3&repo=crypto *** go.crypto/ssh: improve marshal performance Atom N450, 6g benchmark old ns/op ...
13 years, 1 month ago (2012-03-04 22:34:45 UTC) #6
dave_cheney.net
13 years, 1 month ago (2012-03-04 22:43:46 UTC) #7
Thanks for the adjustments to the method names, I agree your versions are an
improvement. 

On 05/03/2012, at 9:34, agl@golang.org wrote:

> *** Submitted as
> http://code.google.com/p/go/source/detail?r=b87c16c531f3&repo=crypto ***
> 
> go.crypto/ssh: improve marshal performance
> 
> Atom N450, 6g
> 
> benchmark                         old ns/op    new ns/op    delta
> BenchmarkMarshalKexInitMsg            96446        66675  -30.87%
> BenchmarkUnmarshalKexInitMsg         155341       142715   -8.13%
> BenchmarkMarshalKexDHInitMsg           9499         8340  -12.20%
> BenchmarkUnmarshalKexDHInitMsg         4973         5145   +3.46%
> 
> Intel E3-1270, 6g
> 
> benchmark                         old ns/op    new ns/op    delta
> BenchmarkMarshalKexInitMsg            23218        16903  -27.20%
> BenchmarkUnmarshalKexInitMsg          31384        31640   +0.82%
> BenchmarkMarshalKexDHInitMsg           1943         1661  -14.51%
> BenchmarkUnmarshalKexDHInitMsg          915          941   +2.84%
> 
> R=agl, minux.ma, remyoudompheng
> CC=golang-dev
> http://codereview.appspot.com/5728053
> 
> Committer: Adam Langley <agl@golang.org>
> 
> 
> 
> http://codereview.appspot.com/5728053/diff/4008/ssh/common.go
> File ssh/common.go (right):
> 
> http://codereview.appspot.com/5728053/diff/4008/ssh/common.go#newcode255
> ssh/common.go:255: func (b *writeBuf) uint8(n uint8) {
> Since this is just putting a function call around append(), I removed
> it.
> 
> http://codereview.appspot.com/5728053/diff/4008/ssh/common.go#newcode259
> ssh/common.go:259: func (b *writeBuf) uint16(n uint16) {
> at that point, it became cleaner to make these appendU16 and so on.
> 
> http://codereview.appspot.com/5728053/
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b