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

gcs: Optimize Hash. #1853

Merged
merged 2 commits into from
Aug 22, 2019
Merged

gcs: Optimize Hash. #1853

merged 2 commits into from
Aug 22, 2019

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Aug 21, 2019

This is rebased on top of #1851.

This adds a benchmark and optimizes the Hash method of gcs filters by making use of the new zero-alloc hashing func available in crypto/blake256.

The following is a before and after comparison:

benchmark       old ns/op   new ns/op    delta
-------------------------------------------------
BenchmarkHash   1786        1315         -26.37%

benchmark       old allocs  new allocs   delta
-------------------------------------------------
BenchmarkHash   2           0            -100.00%

benchmark       old bytes   new bytes    delta
-------------------------------------------------
BenchmarkHash   176         0            -100.00%

This optimizes the Hash method of gcs filters by making use of the new
zero-alloc hashing funcs available in crypto/blake256.

The following is a before and after comparison:

benchmark       old ns/op   new ns/op    delta
-------------------------------------------------
BenchmarkHash   1786        1315         -26.37%

benchmark       old allocs  new allocs   delta
-------------------------------------------------
BenchmarkHash   2           0            -100.00%

benchmark       old bytes   new bytes    delta
-------------------------------------------------
BenchmarkHash   176         0            -100.00%
@davecgh davecgh force-pushed the gcs_optimize_hash branch from 962fa5b to b67fb74 Compare August 22, 2019 15:22
@davecgh davecgh merged commit b67fb74 into decred:master Aug 22, 2019
@davecgh davecgh deleted the gcs_optimize_hash branch August 22, 2019 15:34
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.

3 participants