Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash/crc32: Use "slice-by-8" for Castagnoli and smaller payloads. #14257

Closed
klauspost opened this issue Feb 8, 2016 · 1 comment
Closed

hash/crc32: Use "slice-by-8" for Castagnoli and smaller payloads. #14257

klauspost opened this issue Feb 8, 2016 · 1 comment
Milestone

Comments

@klauspost
Copy link
Contributor

We should add https://github.com/klauspost/crc32 which uses "slicing by 8" optimization to Castagnoli tables which will speed up CRC32 calculation on systems without assembler (all but AMD64).

In my tests, it is faster to use "slicing by 8" for sizes all down to
16 bytes, so the switchover point has been adjusted.

There are no benchmarks for small sizes, so I have added one for 40 bytes,
as well as one for bigger sizes (32KB).

Castagnoli, No assembler, 40 Byte payload: (before, after) 
BenchmarkCastagnoli40B-4   10000000               161 ns/op         246.94   MB/s 
BenchmarkCastagnoli40B-4   20000000               100 ns/op         398.01   MB/s 

Castagnoli, No assembler, 32KB payload: (before, after) 
BenchmarkCastagnoli32KB-4     10000            115426 ns/op         283.89   MB/s 
BenchmarkCastagnoli32KB-4     30000             45171 ns/op         725.41   MB/s 

IEEE, No assembler, 1KB payload: (before, after) 
BenchmarkCrc1KB-4              500000              3604 ns/op           284.10 MB/s 
BenchmarkCrc1KB-4             1000000              1463 ns/op           699.79 MB/s 
@minux minux added this to the Go1.7 milestone Feb 8, 2016
@rsc
Copy link
Contributor

rsc commented May 18, 2016

Done in b212c68 if I understand correctly.

@rsc rsc closed this as completed May 18, 2016
@golang golang locked and limited conversation to collaborators May 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants