1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:31:22 -06:00
go/src/pkg/crypto
Russ Cox 2f32138aba 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://golang.org/cl/7763049
2013-03-21 11:32:02 -04:00
..
aes crypto/aes: speed up using AES-NI on amd64 2012-09-27 01:54:10 +08:00
cipher crypto/cipher: avoid out of bounds error in CryptBlocks 2013-01-30 12:45:13 -08:00
des crypto/des: add an example to demonstrate EDE2 operation. 2012-12-22 10:50:11 -05:00
dsa all: remove now-unnecessary unreachable panics 2013-03-11 14:16:55 -07:00
ecdsa crypto/elliptic: explicitly handle P+P, ∞+P and P+∞ 2012-08-03 15:42:14 -04:00
elliptic crypto/elliptic: explicitly handle P+P, ∞+P and P+∞ 2012-08-03 15:42:14 -04:00
hmac crypto/hmac: add Equal function. 2012-10-11 15:28:02 -04:00
md5 crypto/md5: faster amd64, 386 implementations 2013-03-21 11:26:00 -04:00
rand crypto/rsa: ensure that RSA keys use the full number of bits. 2012-12-28 19:11:37 -05:00
rc4 crypto/rc4: faster amd64, 386 implementations 2013-03-21 11:25:09 -04:00
rsa crypto/rsa: fix infinite loop in GenerateMultiPrimeKey for large nprimes 2013-02-24 17:19:09 +01:00
sha1 crypto/sha1: faster amd64, 386 implementations 2013-03-21 11:32:02 -04:00
sha256 crypto: use better hash benchmarks 2012-11-01 16:21:18 -04:00
sha512 crypto: use better hash benchmarks 2012-11-01 16:21:18 -04:00
subtle build: remove Make.pkg, Make.tool 2012-01-30 23:43:46 -05:00
tls crypto/tls: use method values 2013-03-20 23:53:38 -04:00
x509 all: remove now-unnecessary unreachable panics 2013-03-11 14:16:55 -07:00
crypto.go crypto/...: changes to address some of bug 2841. 2012-02-03 15:08:53 -05:00