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

z: use zeebo/xxh3 instead of cespare/xxhash/v2 #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zchee
Copy link
Contributor

@zchee zchee commented Feb 6, 2025

Description

z: use zeebo/xxh3 instead of cespare/xxhash/v2

goos: darwin
goarch: amd64
pkg: github.com/dgraph-io/ristretto/v2/z
cpu: Intel(R) Xeon(R) W-3245 CPU @ 3.20GHz
                                          │   old.txt    │               new.txt               │
                                          │    sec/op    │   sec/op     vs base                │
KeyToHashBytes/foo-32                        9.588n ± 1%   8.166n ± 0%  -14.82% (p=0.000 n=10)
KeyToHashBytes/barbaz-32                     9.643n ± 1%   8.556n ± 0%  -11.27% (p=0.000 n=10)
KeyToHashBytes/quxquuxquuz-32               10.495n ± 0%   8.242n ± 0%  -21.47% (p=0.000 n=10)
KeyToHashBytes/corgegraultgarplywaldo-32    11.435n ± 0%   9.403n ± 0%  -17.77% (p=0.000 n=10)
KeyToHashString/foo-32                       9.851n ± 1%   7.814n ± 0%  -20.68% (p=0.000 n=10)
KeyToHashString/barbaz-32                    9.917n ± 0%   7.911n ± 0%  -20.23% (p=0.000 n=10)
KeyToHashString/quxquuxquuz-32              11.135n ± 0%   7.917n ± 0%  -28.90% (p=0.000 n=10)
KeyToHashString/corgegraultgarplywaldo-32   12.475n ± 0%   8.805n ± 0%  -29.42% (p=0.000 n=10)
geomean                                      10.52n        8.337n       -20.79%

                                          │   old.txt    │                new.txt                │
                                          │     B/s      │      B/s       vs base                │
KeyToHashBytes/foo-32                       298.4Mi ± 1%    350.3Mi ± 0%  +17.40% (p=0.000 n=10)
KeyToHashBytes/barbaz-32                    593.4Mi ± 1%    668.8Mi ± 0%  +12.70% (p=0.000 n=10)
KeyToHashBytes/quxquuxquuz-32               999.9Mi ± 0%   1272.8Mi ± 0%  +27.30% (p=0.000 n=10)
KeyToHashBytes/corgegraultgarplywaldo-32    1.792Gi ± 0%    2.179Gi ± 0%  +21.60% (p=0.000 n=10)
KeyToHashString/foo-32                      290.4Mi ± 1%    366.1Mi ± 0%  +26.07% (p=0.000 n=10)
KeyToHashString/barbaz-32                   577.0Mi ± 0%    723.3Mi ± 0%  +25.37% (p=0.000 n=10)
KeyToHashString/quxquuxquuz-32              942.5Mi ± 0%   1325.0Mi ± 0%  +40.59% (p=0.000 n=10)
KeyToHashString/corgegraultgarplywaldo-32   1.643Gi ± 0%    2.327Gi ± 0%  +41.66% (p=0.000 n=10)
geomean                                     736.2Mi         929.3Mi       +26.23%

                                          │   old.txt    │               new.txt               │
                                          │     B/op     │    B/op     vs base                 │
KeyToHashBytes/foo-32                       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/barbaz-32                    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/quxquuxquuz-32               0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/corgegraultgarplywaldo-32    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/foo-32                      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/barbaz-32                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/quxquuxquuz-32              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/corgegraultgarplywaldo-32   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                          │   old.txt    │               new.txt               │
                                          │  allocs/op   │ allocs/op   vs base                 │
KeyToHashBytes/foo-32                       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/barbaz-32                    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/quxquuxquuz-32               0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/corgegraultgarplywaldo-32    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/foo-32                      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/barbaz-32                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/quxquuxquuz-32              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/corgegraultgarplywaldo-32   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

Note

Use zeebo/xxh3@7a4a65f1295e instead of latest release of v1.0.2 because have some optimizations:

Checklist

  • Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to
    this PR
  • Tests added for new functionality, or regression tests for bug fixes added as applicable
  • For public APIs, new features, etc., PR on
    docs repo staged and linked here

goos: darwin
goarch: amd64
pkg: github.com/dgraph-io/ristretto/v2/z
cpu: Intel(R) Xeon(R) W-3245 CPU @ 3.20GHz
                                          │   old.txt    │               new.txt               │
                                          │    sec/op    │   sec/op     vs base                │
KeyToHashBytes/foo-32                        9.588n ± 1%   8.166n ± 0%  -14.82% (p=0.000 n=10)
KeyToHashBytes/barbaz-32                     9.643n ± 1%   8.556n ± 0%  -11.27% (p=0.000 n=10)
KeyToHashBytes/quxquuxquuz-32               10.495n ± 0%   8.242n ± 0%  -21.47% (p=0.000 n=10)
KeyToHashBytes/corgegraultgarplywaldo-32    11.435n ± 0%   9.403n ± 0%  -17.77% (p=0.000 n=10)
KeyToHashString/foo-32                       9.851n ± 1%   7.814n ± 0%  -20.68% (p=0.000 n=10)
KeyToHashString/barbaz-32                    9.917n ± 0%   7.911n ± 0%  -20.23% (p=0.000 n=10)
KeyToHashString/quxquuxquuz-32              11.135n ± 0%   7.917n ± 0%  -28.90% (p=0.000 n=10)
KeyToHashString/corgegraultgarplywaldo-32   12.475n ± 0%   8.805n ± 0%  -29.42% (p=0.000 n=10)
geomean                                      10.52n        8.337n       -20.79%

                                          │   old.txt    │                new.txt                │
                                          │     B/s      │      B/s       vs base                │
KeyToHashBytes/foo-32                       298.4Mi ± 1%    350.3Mi ± 0%  +17.40% (p=0.000 n=10)
KeyToHashBytes/barbaz-32                    593.4Mi ± 1%    668.8Mi ± 0%  +12.70% (p=0.000 n=10)
KeyToHashBytes/quxquuxquuz-32               999.9Mi ± 0%   1272.8Mi ± 0%  +27.30% (p=0.000 n=10)
KeyToHashBytes/corgegraultgarplywaldo-32    1.792Gi ± 0%    2.179Gi ± 0%  +21.60% (p=0.000 n=10)
KeyToHashString/foo-32                      290.4Mi ± 1%    366.1Mi ± 0%  +26.07% (p=0.000 n=10)
KeyToHashString/barbaz-32                   577.0Mi ± 0%    723.3Mi ± 0%  +25.37% (p=0.000 n=10)
KeyToHashString/quxquuxquuz-32              942.5Mi ± 0%   1325.0Mi ± 0%  +40.59% (p=0.000 n=10)
KeyToHashString/corgegraultgarplywaldo-32   1.643Gi ± 0%    2.327Gi ± 0%  +41.66% (p=0.000 n=10)
geomean                                     736.2Mi         929.3Mi       +26.23%

                                          │   old.txt    │               new.txt               │
                                          │     B/op     │    B/op     vs base                 │
KeyToHashBytes/foo-32                       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/barbaz-32                    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/quxquuxquuz-32               0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/corgegraultgarplywaldo-32    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/foo-32                      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/barbaz-32                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/quxquuxquuz-32              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/corgegraultgarplywaldo-32   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                          │   old.txt    │               new.txt               │
                                          │  allocs/op   │ allocs/op   vs base                 │
KeyToHashBytes/foo-32                       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/barbaz-32                    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/quxquuxquuz-32               0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashBytes/corgegraultgarplywaldo-32    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/foo-32                      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/barbaz-32                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/quxquuxquuz-32              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
KeyToHashString/corgegraultgarplywaldo-32   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

Signed-off-by: Koichi Shiraishi <[email protected]>
@zchee zchee requested a review from a team as a code owner February 6, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant