Update README.md
1 file changed
tree: 6eeda4b1c866568c25a8850a1f1973d28530e654
  1. .gitignore
  2. .travis.yml
  3. crc32.go
  4. crc32_amd64.go
  5. crc32_amd64.s
  6. crc32_amd64p32.go
  7. crc32_amd64p32.s
  8. crc32_generic.go
  9. crc32_test.go
  10. example_test.go
  11. LICENSE
  12. README.md
README.md

crc32

CRC32 hash with x64 optimizations

This package is a drop-in replacement for the standard library hash/crc32 package, that features SSE 4.2 optimizations on x64 platforms, for a 10x speedup.

Build Status

usage

Install using go get github.com/klauspost/crc32. This library is based on Go 1.5 code and requires Go 1.3 or newer.

Replace import "hash/crc32" with import "github.com/klauspost/crc32" and you are good to go.

performance

For IEEE tables (the most common), there is approximately a factor 10 speedup with “CLMUL” (Carryless multiplication) instruction:

benchmark            old ns/op     new ns/op     delta
BenchmarkCrc32KB     99955         10258         -89.74%

benchmark            old MB/s     new MB/s     speedup
BenchmarkCrc32KB     327.83       3194.20      9.74x

For other tables and “CLMUL” capable machines the performance is the same as the standard library.

This has been submitted and will be part of the Go 1.6 standard library.

license

Standard Go license. Changes are Copyright (c) 2015 Klaus Post under same conditions.