]> Cypherpunks repositories - gostls13.git/commit
runtime: faster aeshash implementation
authorKeith Randall <khr@golang.org>
Wed, 10 Dec 2014 22:20:17 +0000 (14:20 -0800)
committerKeith Randall <khr@golang.org>
Thu, 11 Dec 2014 05:23:00 +0000 (05:23 +0000)
commit7a4a64e8f3dc14717695e53c7560992789f8bc9e
tree2cb7a680b5280f9b698f892f7da3a3a135b095cc
parent69f24cfa14ba982e0118e240021f0e91f8efe937
runtime: faster aeshash implementation

The aesenc instruction has high latency.  For hashing large objects,
hash several streams in parallel.

benchmark                         old ns/op     new ns/op     delta
BenchmarkHash5                    7.02          7.45          +6.13%
BenchmarkHash16                   6.53          6.94          +6.28%
BenchmarkHash32                   8.38          8.26          -1.43%
BenchmarkHash64                   12.6          12.0          -4.76%
BenchmarkHash1024                 247           62.9          -74.53%
BenchmarkHash65536                17335         2966          -82.89%
BenchmarkHashInt32Speed           14.7          14.9          +1.36%
BenchmarkHashInt64Speed           14.6          14.9          +2.05%
BenchmarkHashBytesSpeed           35.4          28.6          -19.21%
BenchmarkHashStringSpeed          22.0          20.4          -7.27%
BenchmarkHashStringArraySpeed     65.8          56.3          -14.44%

Change-Id: Ia8ba03063acc64a9066b8ab2d79f2c9aaac1770f
Reviewed-on: https://go-review.googlesource.com/1330
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/8a/lex.c
src/cmd/8l/8.out.h
src/liblink/asm8.c
src/runtime/alg.go
src/runtime/asm_386.s
src/runtime/asm_amd64.s