Debian Codegraph @

/

debian golang-github-klauspost-crc32 1.3.0-1debian golang-github-klauspost-crc32-dev gomod github.com/klauspost/crc32 debiangogoinimakefilemarkdownshellyaml 26 files · 250 symbols
README (full)

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.

dir .github/
dir debian/
file .gitignore
file LICENSE
file README.md
file crc32.go
file crc32_amd64.go
file crc32_amd64.s
file crc32_arm64.go
file crc32_arm64.s
file crc32_generic.go
file crc32_loong64.go
file crc32_loong64.s
file crc32_otherarch.go
file crc32_ppc64le.go
file crc32_ppc64le.s
file crc32_s390x.go
file crc32_s390x.s
file crc32_table_ppc64le.s
file crc32_test.go
file example_test.go
file gen.go
file gen_const_ppc64le.go
file go.mod
file go.sum