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

Issue 7763049: code review 7763049: crypto/sha1: faster amd64, 386 implementations (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by rsc
Modified:
12 years ago
Reviewers:
CC:
agl1, dave_cheney.net, golang-dev
Visibility:
Public.

Description

crypto/sha1: faster amd64, 386 implementations -- amd64 -- On a MacBookPro10,2 (Core i5): benchmark old ns/op new ns/op delta BenchmarkHash8Bytes 785 592 -24.59% BenchmarkHash1K 8727 3014 -65.46% BenchmarkHash8K 64926 20723 -68.08% benchmark old MB/s new MB/s speedup BenchmarkHash8Bytes 10.19 13.50 1.32x BenchmarkHash1K 117.34 339.71 2.90x BenchmarkHash8K 126.17 395.31 3.13x For comparison, on the same machine, openssl 0.9.8r reports its sha1 speed as 341 MB/s for 1K and 404 MB/s for 8K. On an Intel Xeon E5520: benchmark old ns/op new ns/op delta BenchmarkHash8Bytes 984 707 -28.15% BenchmarkHash1K 11141 3466 -68.89% BenchmarkHash8K 82435 23411 -71.60% benchmark old MB/s new MB/s speedup BenchmarkHash8Bytes 8.13 11.31 1.39x BenchmarkHash1K 91.91 295.36 3.21x BenchmarkHash8K 99.37 349.91 3.52x For comparison, on the same machine, openssl 1.0.1 reports its sha1 speed as 286 MB/s for 1K and 394 MB/s for 8K. -- 386 -- On a MacBookPro10,2 (Core i5): benchmark old ns/op new ns/op delta BenchmarkHash8Bytes 1041 713 -31.51% BenchmarkHash1K 15612 3382 -78.34% BenchmarkHash8K 110152 22733 -79.36% benchmark old MB/s new MB/s speedup BenchmarkHash8Bytes 7.68 11.21 1.46x BenchmarkHash1K 65.59 302.76 4.62x BenchmarkHash8K 74.37 360.36 4.85x On an Intel Xeon E5520: benchmark old ns/op new ns/op delta BenchmarkHash8Bytes 1221 842 -31.04% BenchmarkHash1K 14643 4137 -71.75% BenchmarkHash8K 108722 27394 -74.80% benchmark old MB/s new MB/s speedup BenchmarkHash8Bytes 6.55 9.49 1.45x BenchmarkHash1K 69.93 247.51 3.54x BenchmarkHash8K 75.35 299.04 3.97x

Patch Set 1 #

Patch Set 2 : diff -r 8cc853b84f89 https://go.googlecode.com/hg/ #

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

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

Total comments: 10

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+460 lines, -0 lines) Patch
M src/pkg/crypto/sha1/sha1block.go View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A src/pkg/crypto/sha1/sha1block_386.s View 1 2 3 4 1 chunk +233 lines, -0 lines 0 comments Download
A src/pkg/crypto/sha1/sha1block_amd64.s View 1 2 3 4 1 chunk +216 lines, -0 lines 0 comments Download
A src/pkg/crypto/sha1/sha1block_decl.go View 1 2 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 8
rsc
Hello agl@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
12 years ago (2013-03-21 05:31:41 UTC) #1
dave_cheney.net
On 2013/03/21 05:31:41, rsc wrote: > Hello mailto:agl@golang.org (cc: mailto:golang-dev@googlegroups.com), > > I'd like you ...
12 years ago (2013-03-21 05:38:02 UTC) #2
rsc
On Thu, Mar 21, 2013 at 1:38 AM, <dave@cheney.net> wrote: > On 2013/03/21 05:31:41, rsc ...
12 years ago (2013-03-21 05:42:08 UTC) #3
dave_cheney.net
Fair enough, just thought I would ask. On Thu, Mar 21, 2013 at 4:42 PM, ...
12 years ago (2013-03-21 05:48:34 UTC) #4
nigeltao
https://codereview.appspot.com/7763049/diff/8001/src/pkg/crypto/sha1/sha1block_386.s File src/pkg/crypto/sha1/sha1block_386.s (right): https://codereview.appspot.com/7763049/diff/8001/src/pkg/crypto/sha1/sha1block_386.s#newcode22 src/pkg/crypto/sha1/sha1block_386.s:22: // To free up the word pointer (R10), we ...
12 years ago (2013-03-21 07:14:50 UTC) #5
agl1
LGTM https://codereview.appspot.com/7763049/diff/8001/src/pkg/crypto/sha1/sha1block_386.s File src/pkg/crypto/sha1/sha1block_386.s (right): https://codereview.appspot.com/7763049/diff/8001/src/pkg/crypto/sha1/sha1block_386.s#newcode26 src/pkg/crypto/sha1/sha1block_386.s:26: MOVL 88(SP), SI; \ It is possible to ...
12 years ago (2013-03-21 11:26:32 UTC) #6
rsc
https://codereview.appspot.com/7763049/diff/8001/src/pkg/crypto/sha1/sha1block_386.s File src/pkg/crypto/sha1/sha1block_386.s (right): https://codereview.appspot.com/7763049/diff/8001/src/pkg/crypto/sha1/sha1block_386.s#newcode22 src/pkg/crypto/sha1/sha1block_386.s:22: // To free up the word pointer (R10), we ...
12 years ago (2013-03-21 15:31:51 UTC) #7
rsc
12 years ago (2013-03-21 15:32:06 UTC) #8
*** Submitted as https://code.google.com/p/go/source/detail?r=e73043345273 ***

crypto/sha1: faster amd64, 386 implementations

-- amd64 --

On a MacBookPro10,2 (Core i5):

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes          785          592  -24.59%
BenchmarkHash1K             8727         3014  -65.46%
BenchmarkHash8K            64926        20723  -68.08%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes        10.19        13.50    1.32x
BenchmarkHash1K           117.34       339.71    2.90x
BenchmarkHash8K           126.17       395.31    3.13x

For comparison, on the same machine, openssl 0.9.8r reports
its sha1 speed as 341 MB/s for 1K and 404 MB/s for 8K.

On an Intel Xeon E5520:

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes          984          707  -28.15%
BenchmarkHash1K            11141         3466  -68.89%
BenchmarkHash8K            82435        23411  -71.60%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         8.13        11.31    1.39x
BenchmarkHash1K            91.91       295.36    3.21x
BenchmarkHash8K            99.37       349.91    3.52x

For comparison, on the same machine, openssl 1.0.1 reports
its sha1 speed as 286 MB/s for 1K and 394 MB/s for 8K.

-- 386 --

On a MacBookPro10,2 (Core i5):

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1041          713  -31.51%
BenchmarkHash1K            15612         3382  -78.34%
BenchmarkHash8K           110152        22733  -79.36%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         7.68        11.21    1.46x
BenchmarkHash1K            65.59       302.76    4.62x
BenchmarkHash8K            74.37       360.36    4.85x

On an Intel Xeon E5520:

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1221          842  -31.04%
BenchmarkHash1K            14643         4137  -71.75%
BenchmarkHash8K           108722        27394  -74.80%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         6.55         9.49    1.45x
BenchmarkHash1K            69.93       247.51    3.54x
BenchmarkHash8K            75.35       299.04    3.97x

R=agl, dave
CC=golang-dev
https://codereview.appspot.com/7763049
Sign in to reply to this message.

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