Skip to content

proto: hash with go-simd/crc64 - #8

Merged
tannevaled merged 1 commit into
mainfrom
crc64-simd
Nov 22, 2026
Merged

tannevaled merged 1 commit into
mainfrom
crc64-simd

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Switches proto.Fingerprint (proto/proto.go:176, CRC-64/ECMA over a whole file, so MiB-scale input) from hash/crc64 to github.com/go-simd/crc64 v0.3.0, a drop-in with the same Table type and bit-identical output. The committed benchmark proto/crc_bench_test.go asserts equal checksums at every size.

Measured on fractal (Ryzen 9 7950X, Zen 4, linux/amd64), taskset one core, 6 interleaved rounds, 1-min load 0.6-1.2. Median ns/op and MB/s:

size std ns/op std MB/s simd ns/op simd MB/s
16 B 14.85 1077 15.25 1050
64 B 25.5 2508 26.7 2399
256 B 90.8 2819 91.2 2807
1 KiB 350 2926 217 4709
4 KiB 1380 2960 437 9370
64 KiB 22000 2976 4940 13260
1 MiB 353000 2970 77500 13520
10 MiB 3538000 2963 768000 13650

Up to 256 B it is a tie (within 5 %, below 100 ns, not a real worker size); from 1 KiB it is 1.6x to 4.6x faster. arm64 not measured (host load above 8).

🤖 Generated with Claude Code

Fingerprint hashes whole media files (MiB scale). Same ECMA table, bit-identical
output (the benchmark asserts equality), 4.6x faster from 1 MiB up on Zen 4.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 64366c8 into main Nov 22, 2026
8 checks passed
@tannevaled
tannevaled deleted the crc64-simd branch November 22, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant