FAQ
https://codereview.appspot.com/6820096/diff/6001/src/pkg/crypto/sha1/sha1block.go
File src/pkg/crypto/sha1/sha1block.go (right):

https://codereview.appspot.com/6820096/diff/6001/src/pkg/crypto/sha1/sha1block.go#newcode35
src/pkg/crypto/sha1/sha1block.go:35: for i := 0; i < 16; i++ {
lifting i outside the for loop, then not initalising it again lower down
gets another 2% on amd64

i := 0
for ; i < 16 ; i++

lucky(~/go/src/pkg/crypto/sha1) % ~/go/misc/benchcmp {old,new}.txt
benchmark old ns/op new ns/op delta
BenchmarkHash8Bytes 863 819 -5.10%
BenchmarkHash1K 10049 9499 -5.47%
BenchmarkHash8K 74555 70395 -5.58%

benchmark old MB/s new MB/s speedup
BenchmarkHash8Bytes 9.27 9.76 1.05x
BenchmarkHash1K 101.90 107.80 1.06x
BenchmarkHash8K 109.88 116.37 1.06x

https://codereview.appspot.com/6820096/diff/6001/src/pkg/crypto/sha1/sha1block.go#newcode42
src/pkg/crypto/sha1/sha1block.go:42: for i := 16; i < 20; i++ {
for ; i < 20; i++ { .. }
and so forth

https://codereview.appspot.com/6820096/

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 20 | next ›
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 6, '12 at 3:22a
activeNov 7, '12 at 2:41a
posts20
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase