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

Improve the hash rate of the Hash function #118

Open
dkrutsko opened this issue Apr 15, 2021 · 0 comments
Open

Improve the hash rate of the Hash function #118

dkrutsko opened this issue Apr 15, 2021 · 0 comments
Labels
Request A cool feature request for the library
Milestone

Comments

@dkrutsko
Copy link
Member

dkrutsko commented Apr 15, 2021

Currently, the Hash class has abysmal performance when compared to other CRC32 algorithms. Looking at our options here, here and here, it's clear that there's a lot of improvements which could be made. Read the table below to see how we compare (Ignore the differences in the result as the comparison uses the iSCSI/Castagnoli polynomial where as we use the Ethernet/ZIP one).

Option Result Performance
Naive - CPP 0xA0B96C51 147.0 MB/s = 0.29 bits/cycle
Tabular - 1 byte 0xA0B96C51 556.6 MB/s = 1.11 bits/cycle
Robot - Hash 0x1D75653D 561.1 MB/s = 1.12 bits/cycle
Tabular - 2 bytes 0xA0B96C51 795.3 MB/s = 1.59 bits/cycle
Hardware - 1 byte 0xA0B96C51 1324.1 MB/s = 2.65 bits/cycle
Tabular - 4 bytes 0xA0B96C51 1369.0 MB/s = 2.74 bits/cycle
Tabular - 8 bytes 0xA0B96C51 2416.1 MB/s = 4.83 bits/cycle
Checksums - AWS 0x1D75653D 2682.3 MB/s = 5.36 bits/cycle
Tabular - 16 bytes 0xA0B96C51 4011.5 MB/s = 8.02 bits/cycle
Hardware - 8 bytes 0xA0B96C51 10538.0 MB/s = 21.08 bits/cycle
Golden - AMD 0xA0B96C51 19564.9 MB/s = 39.13 bits/cycle
Golden - Intel 0xA0B96C51 30507.4 MB/s = 61.01 bits/cycle
@dkrutsko dkrutsko added the Request A cool feature request for the library label Mar 25, 2022
@dkrutsko dkrutsko added this to the Robot 2.1.0 milestone Mar 25, 2022
@dkrutsko dkrutsko changed the title Consider using the CRC32 intrinsic for the hash class Improve the hash rate of the Hash function Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request A cool feature request for the library
Development

No branches or pull requests

1 participant