]> Cypherpunks repositories - gostls13.git/commit
hash/crc32: add AMD64 optimized IEEE CRC calculation
authorKlaus Post <klauspost@gmail.com>
Sun, 30 Aug 2015 20:29:00 +0000 (22:29 +0200)
committerKeith Randall <khr@golang.org>
Wed, 16 Sep 2015 15:42:42 +0000 (15:42 +0000)
commit2027b00e63d9128eaba4a0164072380561c0fc9c
tree695d5e7e309a640313266ce833f22c52ce49206a
parentf0ea976ee4591785fb028b77bcd02fb8590650ed
hash/crc32: add AMD64 optimized IEEE CRC calculation

IEEE is the most commonly used CRC-32 polynomial, used by zip, gzip and others.

Based on http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf

benchmark                       old ns/op     new ns/op     delta
BenchmarkIEEECrc1KB-8           3193          352           -88.98%
BenchmarkIEEECrc4KB-8           5025          1307          -73.99%
BenchmarkCastagnoliCrc1KB-8     126           126           +0.00%

benchmark                       old MB/s     new MB/s     speedup
BenchmarkIEEECrc1KB-8           320.68       2901.92      9.05x
BenchmarkIEEECrc4KB-8           815.08       3131.80      3.84x
BenchmarkCastagnoliCrc1KB-8     8100.80      8109.78      1.00x

Change-Id: I99c9a48365f631827f516e44f97e86155f03cb90
Reviewed-on: https://go-review.googlesource.com/14080
Reviewed-by: Keith Randall <khr@golang.org>
src/hash/crc32/crc32.go
src/hash/crc32/crc32_amd64.go [new file with mode: 0644]
src/hash/crc32/crc32_amd64.s
src/hash/crc32/crc32_amd64p32.go [moved from src/hash/crc32/crc32_amd64x.go with 63% similarity]
src/hash/crc32/crc32_generic.go