-
Notifications
You must be signed in to change notification settings - Fork 126
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: cespare/xxhash
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: cespare/xxhash
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 16 commits
- 15 files changed
- 3 contributors
Commits on Oct 17, 2018
-
Updating README.md with reference to freecache
* Freecache recently changed to use this hashing strategy
Configuration menu - View commit details
-
Copy full SHA for 096ff4a - Browse repository at this point
Copy the full SHA 096ff4aView commit details
Commits on Nov 29, 2018
-
Configuration menu - View commit details
-
Copy full SHA for f177858 - Browse repository at this point
Copy the full SHA f177858View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9573aff - Browse repository at this point
Copy the full SHA 9573affView commit details
Commits on Dec 31, 2018
-
Change writeBlocks signature to avoid making xxh escape
Thanks to @ongardie for the suggestion.
Configuration menu - View commit details
-
Copy full SHA for 6e60139 - Browse repository at this point
Copy the full SHA 6e60139View commit details
Commits on Jan 1, 2019
-
Add more benchmarks using New(), etc
The current 100B hash results on my MacBook Pro with Go v1.11.2 are: name time/op tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 16.3ns ± 2% Hashes/xxhash,direct,string,n=100_B-4 18.7ns ± 2% Hashes/xxhash,digest,bytes,n=100_B-4 51.8ns ± 1% Hashes/xxhash,digest,string,n=100_B-4 100ns ±26% Hashes/OneOfOne,direct,bytes,n=100_B-4 22.5ns ± 1% Hashes/OneOfOne,direct,string,n=100_B-4 24.3ns ± 1% Hashes/OneOfOne,digest,bytes,n=100_B-4 38.2ns ± 1% Hashes/OneOfOne,digest,string,n=100_B-4 40.1ns ± 2% Hashes/murmur3,direct,bytes,n=100_B-4 33.9ns ± 1% Hashes/murmur3,direct,string,n=100_B-4 72.9ns ± 1% Hashes/murmur3,digest,bytes,n=100_B-4 85.1ns ± 1% Hashes/murmur3,digest,string,n=100_B-4 125ns ± 1% Hashes/CRC-32,direct,bytes,n=100_B-4 36.5ns ± 2% Hashes/CRC-32,direct,string,n=100_B-4 81.6ns ± 8% Hashes/CRC-32,digest,bytes,n=100_B-4 72.8ns ± 1% Hashes/CRC-32,digest,string,n=100_B-4 110ns ± 2% Hashes/fnv1a,digest,bytes,n=100_B-4 122ns ± 1% Hashes/fnv1a,digest,string,n=100_B-4 158ns ± 1% tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 17.6ns ± 2% Hashes/xxhash,direct,string,n=100_B-4 19.9ns ± 1% Hashes/xxhash,digest,bytes,n=100_B-4 58.9ns ± 1% Hashes/xxhash,digest,string,n=100_B-4 96.7ns ± 1% name speed tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 6.14GB/s ± 2% Hashes/xxhash,direct,string,n=100_B-4 5.35GB/s ± 2% Hashes/xxhash,digest,bytes,n=100_B-4 1.93GB/s ± 1% Hashes/xxhash,digest,string,n=100_B-4 1.01GB/s ±22% Hashes/OneOfOne,direct,bytes,n=100_B-4 4.44GB/s ± 2% Hashes/OneOfOne,direct,string,n=100_B-4 4.11GB/s ± 1% Hashes/OneOfOne,digest,bytes,n=100_B-4 2.62GB/s ± 1% Hashes/OneOfOne,digest,string,n=100_B-4 2.50GB/s ± 1% Hashes/murmur3,direct,bytes,n=100_B-4 2.95GB/s ± 1% Hashes/murmur3,direct,string,n=100_B-4 1.37GB/s ± 1% Hashes/murmur3,digest,bytes,n=100_B-4 1.18GB/s ± 1% Hashes/murmur3,digest,string,n=100_B-4 798MB/s ± 2% Hashes/CRC-32,direct,bytes,n=100_B-4 2.74GB/s ± 2% Hashes/CRC-32,direct,string,n=100_B-4 1.23GB/s ± 8% Hashes/CRC-32,digest,bytes,n=100_B-4 1.37GB/s ± 1% Hashes/CRC-32,digest,string,n=100_B-4 906MB/s ± 2% Hashes/fnv1a,digest,bytes,n=100_B-4 816MB/s ± 1% Hashes/fnv1a,digest,string,n=100_B-4 630MB/s ± 2% tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 5.68GB/s ± 2% Hashes/xxhash,direct,string,n=100_B-4 5.02GB/s ± 1% Hashes/xxhash,digest,bytes,n=100_B-4 1.70GB/s ± 1% Hashes/xxhash,digest,string,n=100_B-4 1.03GB/s ± 1% name alloc/op tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00B Hashes/xxhash,direct,string,n=100_B-4 0.00B Hashes/xxhash,digest,bytes,n=100_B-4 80.0B ± 0% Hashes/xxhash,digest,string,n=100_B-4 192B ± 0% Hashes/OneOfOne,direct,bytes,n=100_B-4 0.00B Hashes/OneOfOne,direct,string,n=100_B-4 0.00B Hashes/OneOfOne,digest,bytes,n=100_B-4 0.00B Hashes/OneOfOne,digest,string,n=100_B-4 0.00B Hashes/murmur3,direct,bytes,n=100_B-4 0.00B Hashes/murmur3,direct,string,n=100_B-4 112B ± 0% Hashes/murmur3,digest,bytes,n=100_B-4 96.0B ± 0% Hashes/murmur3,digest,string,n=100_B-4 208B ± 0% Hashes/CRC-32,direct,bytes,n=100_B-4 0.00B Hashes/CRC-32,direct,string,n=100_B-4 112B ± 0% Hashes/CRC-32,digest,bytes,n=100_B-4 16.0B ± 0% Hashes/CRC-32,digest,string,n=100_B-4 128B ± 0% Hashes/fnv1a,digest,bytes,n=100_B-4 8.00B ± 0% Hashes/fnv1a,digest,string,n=100_B-4 120B ± 0% tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00B Hashes/xxhash,direct,string,n=100_B-4 0.00B Hashes/xxhash,digest,bytes,n=100_B-4 80.0B ± 0% Hashes/xxhash,digest,string,n=100_B-4 192B ± 0% name allocs/op tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00 Hashes/xxhash,direct,string,n=100_B-4 0.00 Hashes/xxhash,digest,bytes,n=100_B-4 1.00 ± 0% Hashes/xxhash,digest,string,n=100_B-4 2.00 ± 0% Hashes/OneOfOne,direct,bytes,n=100_B-4 0.00 Hashes/OneOfOne,direct,string,n=100_B-4 0.00 Hashes/OneOfOne,digest,bytes,n=100_B-4 0.00 Hashes/OneOfOne,digest,string,n=100_B-4 0.00 Hashes/murmur3,direct,bytes,n=100_B-4 0.00 Hashes/murmur3,direct,string,n=100_B-4 1.00 ± 0% Hashes/murmur3,digest,bytes,n=100_B-4 1.00 ± 0% Hashes/murmur3,digest,string,n=100_B-4 2.00 ± 0% Hashes/CRC-32,direct,bytes,n=100_B-4 0.00 Hashes/CRC-32,direct,string,n=100_B-4 1.00 ± 0% Hashes/CRC-32,digest,bytes,n=100_B-4 1.00 ± 0% Hashes/CRC-32,digest,string,n=100_B-4 2.00 ± 0% Hashes/fnv1a,digest,bytes,n=100_B-4 1.00 ± 0% Hashes/fnv1a,digest,string,n=100_B-4 2.00 ± 0% tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00 Hashes/xxhash,direct,string,n=100_B-4 0.00 Hashes/xxhash,digest,bytes,n=100_B-4 1.00 ± 0% Hashes/xxhash,digest,string,n=100_B-4 2.00 ± 0% Note that the memory allocations currently dominate the xxhash,digest benchmarks, as reported in #13 Benchmark taken with: ( echo 'tags: !purego' go test -benchtime 3s -count 7 -benchmem -bench '/.*n=100_B' echo 'tags: purego' go test -benchtime 3s -count 7 -benchmem -tags purego -bench '/xx.*n=100_B' ) > base.txt benchstat -split tags base.txt
Configuration menu - View commit details
-
Copy full SHA for 15c3e70 - Browse repository at this point
Copy the full SHA 15c3e70View commit details -
Update New() to return *Digest (breaking change)
New used to return a hash.Hash64. This resulted in unnecessary memory allocations for the caller, and it prevented the returned value from exposing additional methods like WriteString. Digest still implements hash.Hash64, so callers may continue to use it as before. This is a breaking change that may affect some users. Specifically, the following code will no longer work: var myHashFunc func() hash.Hash64 myHashFunc = xxhash.New See #13. This commit also changes the formatting on the README slightly. The * in *Digest caused it to render poorly when simply indenting the godoc output, so this commit switches it to ``` instead. Here is the delta with the previous commit as a baseline. Note the redution in memory allocations. name old time/op new time/op delta tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 16.3ns ± 2% 16.7ns ± 1% +2.37% (p=0.001 n=7+7) Hashes/xxhash,direct,string,n=100_B-4 18.7ns ± 2% 19.0ns ± 1% +1.87% (p=0.005 n=7+6) Hashes/xxhash,digest,bytes,n=100_B-4 51.8ns ± 1% 29.4ns ± 1% -43.28% (p=0.001 n=7+7) Hashes/xxhash,digest,string,n=100_B-4 100ns ±26% 67ns ± 1% -33.57% (p=0.001 n=7+7) tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 17.6ns ± 2% 17.8ns ± 2% +1.22% (p=0.038 n=7+7) Hashes/xxhash,direct,string,n=100_B-4 19.9ns ± 1% 20.1ns ± 2% ~ (p=0.266 n=6+7) Hashes/xxhash,digest,bytes,n=100_B-4 58.9ns ± 1% 38.4ns ± 2% -34.80% (p=0.000 n=7+6) Hashes/xxhash,digest,string,n=100_B-4 96.7ns ± 1% 92.3ns ±28% ~ (p=0.209 n=7+7) name old speed new speed delta tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 6.14GB/s ± 2% 6.00GB/s ± 1% -2.28% (p=0.001 n=7+7) Hashes/xxhash,direct,string,n=100_B-4 5.35GB/s ± 2% 5.24GB/s ± 1% -2.02% (p=0.002 n=7+6) Hashes/xxhash,digest,bytes,n=100_B-4 1.93GB/s ± 1% 3.40GB/s ± 1% +76.20% (p=0.001 n=7+7) Hashes/xxhash,digest,string,n=100_B-4 1.01GB/s ±22% 1.50GB/s ± 1% +48.36% (p=0.001 n=7+7) tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 5.68GB/s ± 2% 5.61GB/s ± 1% -1.27% (p=0.026 n=7+7) Hashes/xxhash,direct,string,n=100_B-4 5.02GB/s ± 1% 4.99GB/s ± 2% ~ (p=0.234 n=6+7) Hashes/xxhash,digest,bytes,n=100_B-4 1.70GB/s ± 1% 2.60GB/s ± 2% +53.35% (p=0.001 n=7+6) Hashes/xxhash,digest,string,n=100_B-4 1.03GB/s ± 1% 1.10GB/s ±23% ~ (p=0.209 n=7+7) name old alloc/op new alloc/op delta tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,direct,string,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,digest,bytes,n=100_B-4 80.0B ± 0% 0.0B -100.00% (p=0.001 n=7+7) Hashes/xxhash,digest,string,n=100_B-4 192B ± 0% 112B ± 0% -41.67% (p=0.001 n=7+7) tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,direct,string,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,digest,bytes,n=100_B-4 80.0B ± 0% 0.0B -100.00% (p=0.001 n=7+7) Hashes/xxhash,digest,string,n=100_B-4 192B ± 0% 112B ± 0% -41.67% (p=0.001 n=7+7) name old allocs/op new allocs/op delta tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,direct,string,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,digest,bytes,n=100_B-4 1.00 ± 0% 0.00 -100.00% (p=0.001 n=7+7) Hashes/xxhash,digest,string,n=100_B-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.001 n=7+7) tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,direct,string,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,digest,bytes,n=100_B-4 1.00 ± 0% 0.00 -100.00% (p=0.001 n=7+7) Hashes/xxhash,digest,string,n=100_B-4 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.001 n=7+7)
Configuration menu - View commit details
-
Copy full SHA for 9db2993 - Browse repository at this point
Copy the full SHA 9db2993View commit details -
This helps avoid a memory allocations when hashing strings using a Digest. See #13. Here's the delta with the previous commit, showing how WriteString avoids the last alllocation. name old time/op new time/op delta tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 16.7ns ± 1% 17.5ns ±11% ~ (p=0.500 n=7+6) Hashes/xxhash,direct,string,n=100_B-4 19.0ns ± 1% 19.1ns ± 2% ~ (p=0.925 n=6+7) Hashes/xxhash,digest,bytes,n=100_B-4 29.4ns ± 1% 29.5ns ± 2% ~ (p=0.730 n=7+7) Hashes/xxhash,digest,string,n=100_B-4 66.6ns ± 1% 32.5ns ± 1% -51.27% (p=0.001 n=7+6) tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 17.8ns ± 2% 17.7ns ± 1% ~ (p=0.461 n=7+7) Hashes/xxhash,direct,string,n=100_B-4 20.1ns ± 2% 20.0ns ± 1% ~ (p=0.867 n=7+7) Hashes/xxhash,digest,bytes,n=100_B-4 38.4ns ± 2% 38.1ns ± 2% ~ (p=0.133 n=6+7) Hashes/xxhash,digest,string,n=100_B-4 92.3ns ±28% 41.2ns ± 1% -55.34% (p=0.001 n=7+7) name old speed new speed delta tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 6.00GB/s ± 1% 5.50GB/s ±26% ~ (p=0.383 n=7+7) Hashes/xxhash,direct,string,n=100_B-4 5.24GB/s ± 1% 5.25GB/s ± 2% ~ (p=0.945 n=6+7) Hashes/xxhash,digest,bytes,n=100_B-4 3.40GB/s ± 1% 3.39GB/s ± 2% ~ (p=1.000 n=7+7) Hashes/xxhash,digest,string,n=100_B-4 1.50GB/s ± 1% 3.07GB/s ± 2% +104.55% (p=0.001 n=7+7) tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 5.61GB/s ± 1% 5.64GB/s ± 1% ~ (p=0.259 n=7+7) Hashes/xxhash,direct,string,n=100_B-4 4.99GB/s ± 2% 4.99GB/s ± 1% ~ (p=0.710 n=7+7) Hashes/xxhash,digest,bytes,n=100_B-4 2.60GB/s ± 2% 2.62GB/s ± 2% ~ (p=0.181 n=6+7) Hashes/xxhash,digest,string,n=100_B-4 1.10GB/s ±23% 2.43GB/s ± 1% +120.31% (p=0.001 n=7+7) name old alloc/op new alloc/op delta tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,direct,string,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,digest,bytes,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,digest,string,n=100_B-4 112B ± 0% 0B -100.00% (p=0.001 n=7+7) tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,direct,string,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,digest,bytes,n=100_B-4 0.00B 0.00B ~ (all equal) Hashes/xxhash,digest,string,n=100_B-4 112B ± 0% 0B -100.00% (p=0.001 n=7+7) name old allocs/op new allocs/op delta tags:!purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,direct,string,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,digest,bytes,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,digest,string,n=100_B-4 1.00 ± 0% 0.00 -100.00% (p=0.001 n=7+7) tags:purego Hashes/xxhash,direct,bytes,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,direct,string,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,digest,bytes,n=100_B-4 0.00 0.00 ~ (all equal) Hashes/xxhash,digest,string,n=100_B-4 1.00 ± 0% 0.00 -100.00% (p=0.001 n=7+7)
Configuration menu - View commit details
-
Copy full SHA for f728abc - Browse repository at this point
Copy the full SHA f728abcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d72dfe - Browse repository at this point
Copy the full SHA 9d72dfeView commit details -
Configuration menu - View commit details
-
Copy full SHA for bf43f18 - Browse repository at this point
Copy the full SHA bf43f18View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2631520 - Browse repository at this point
Copy the full SHA 2631520View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd51581 - Browse repository at this point
Copy the full SHA fd51581View commit details
Commits on Jan 4, 2019
-
Configuration menu - View commit details
-
Copy full SHA for b821ea8 - Browse repository at this point
Copy the full SHA b821ea8View commit details -
No point in keeping this around. Running automated tests with various build tags is good enough.
Configuration menu - View commit details
-
Copy full SHA for 733af8e - Browse repository at this point
Copy the full SHA 733af8eView commit details -
Remove pre-Go1.9 fallback code
Go 1.12beta1 is out and even Appengine's oldest runtime is Go 1.9, so get rid of pre-1.9 fallback code and always use math/bits.
Configuration menu - View commit details
-
Copy full SHA for 7052e46 - Browse repository at this point
Copy the full SHA 7052e46View commit details -
Configuration menu - View commit details
-
Copy full SHA for 30d0e5b - Browse repository at this point
Copy the full SHA 30d0e5bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b82fb7 - Browse repository at this point
Copy the full SHA 3b82fb7View commit details
There are no files selected for viewing
This file was deleted.
This file was deleted.