这是indexloc提供的服务,不要输入任何密码
Clone this repo:
  1. 8d0d1a3 Update README.md by Klaus Post · 2 days ago master v1.3.0
  2. 6119f43 Fix CI. (#21) by Klaus Post · 2 days ago
  3. b065977 Add AVX512 IEEE checksums (#20) by Klaus Post · 2 days ago
  4. bab58d7 Update README.md by Klaus Post · 8 years ago v1.2.0
  5. 22a7f3e Merge pull request #18 from hiveminded/master by Klaus Post · 8 years ago

2025 revival

For IEEE checksums AVX512 can be used to speed up CRC32 checksums by approximately 2x.

Castagnoli checksums (CRC32C) can also be computer with AVX512, but the performance gain is not as significant enough for the downsides of using it at this point.

crc32

This package is a drop-in replacement for the standard library hash/crc32 package, that features AVX 512 optimizations on x64 platforms, for a 2x speedup for IEEE CRC32 checksums.

usage

Install using go get github.com/klauspost/crc32. This library is based on Go 1.24

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

changes

  • 2025: Revived and updated to Go 1.24, with AVX 512 optimizations.

performance

AVX512 are enabled above 1KB input size. This rather high limit is due to AVX512 may be slower to ramp up than the regular SSE4 implementation for smaller inputs. This is not reflected in the benchmarks below.

BenchmarkOld MB/sNew MB/sSpeedup
BenchmarkCRC32/poly=IEEE/size=512/align=0-3217996.3917969.941.00x
BenchmarkCRC32/poly=IEEE/size=512/align=1-3218021.4817945.551.00x
BenchmarkCRC32/poly=IEEE/size=1kB/align=0-3219921.7045613.772.29x
BenchmarkCRC32/poly=IEEE/size=1kB/align=1-3219946.6046819.092.35x
BenchmarkCRC32/poly=IEEE/size=4kB/align=0-3221538.6548600.932.26x
BenchmarkCRC32/poly=IEEE/size=4kB/align=1-3221449.2048477.842.26x
BenchmarkCRC32/poly=IEEE/size=32kB/align=0-3221785.4946013.102.11x
BenchmarkCRC32/poly=IEEE/size=32kB/align=1-3221946.4745954.102.09x

cpu: AMD Ryzen 9 9950X 16-Core Processor

license

Standard Go license. See LICENSE for details.