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

Add hash.XxHash #12636

Merged
merged 1 commit into from
Jul 6, 2024
Merged

Add hash.XxHash #12636

merged 1 commit into from
Jul 6, 2024

Conversation

bep
Copy link
Member

@bep bep commented Jul 3, 2024

Also move the non crypto hash funcs into this new package.

This is much faster than e.g. MD5, especially for larger inputs:

BenchmarkXxHash/xxHash_43-10         	 9917955	       112.2 ns/op	      56 B/op	       4 allocs/op
BenchmarkXxHash/mdb5_43-10           	 6017239	       204.1 ns/op	      96 B/op	       3 allocs/op
BenchmarkXxHash/fnv32a_43-10         	14407333	        82.30 ns/op	      16 B/op	       1 allocs/op
BenchmarkXxHash/xxHash_4300-10       	 2916892	       409.7 ns/op	      56 B/op	       4 allocs/op
BenchmarkXxHash/mdb5_4300-10         	  159748	      7491 ns/op	    4912 B/op	       3 allocs/op
BenchmarkXxHash/fnv32a_4300-10       	  218210	      5510 ns/op	      16 B/op	       1 allocs/op

Fixes #12635

@bep bep force-pushed the feat/xxhash-12635 branch 2 times, most recently from 441e558 to fe143de Compare July 3, 2024 10:08
Also move the non crypto hash funcs into this new package.

This is much faster than e.g. MD5, especially for larger inputs:

```
BenchmarkXxHash/xxHash_43-10         	 9917955	       112.2 ns/op	      56 B/op	       4 allocs/op
BenchmarkXxHash/mdb5_43-10           	 6017239	       204.1 ns/op	      96 B/op	       3 allocs/op
BenchmarkXxHash/fnv32a_43-10         	14407333	        82.30 ns/op	      16 B/op	       1 allocs/op
BenchmarkXxHash/xxHash_4300-10       	 2916892	       409.7 ns/op	      56 B/op	       4 allocs/op
BenchmarkXxHash/mdb5_4300-10         	  159748	      7491 ns/op	    4912 B/op	       3 allocs/op
BenchmarkXxHash/fnv32a_4300-10       	  218210	      5510 ns/op	      16 B/op	       1 allocs/op
```

Fixes gohugoio#12635
@bep
Copy link
Member Author

bep commented Jul 3, 2024

@jmooring if I could have your attention for a minute; adding this func should be a no-brainer looking at the benchmarks, but what about the naming?

@bep
Copy link
Member Author

bep commented Jul 6, 2024

I need this for #12643 and the name should be fine, merging.

@bep bep merged commit 644d554 into gohugoio:master Jul 6, 2024
7 checks passed
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.

Add hash.XxHash
1 participant