-
Notifications
You must be signed in to change notification settings - Fork 125
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
Remove duplicated function definitions #22
Comments
I did look into this after Go 1.13 came out and noticed that adding back the forwarding functions caused the benchmarks to get slower. I didn't look into it much more. I took a closer look today and discovered that the situation is more nuanced (at least with Go 1.15):
The benchmarks are written to be kind of generic and use indirect calls. But I suspect anyone who cares about spending an extra 2ns hashing a small string is using direct calls. So I'm tempted to add the forwarding functions and also rewrite the benchmarks to not use indirect calls. |
As of Go 1.13 this can be inlined so it doesn't add overhead. Fixes #22.
Move the important benchmarks back into the xxhash package itself. Updates #22
I did the benchmarking change in e0ea1e3. Just in case someone does care, I'll make the forwarding function change as part of v3. |
The comparison benchmarks can do direct calls if they're written with build tags. I did that in my Bloom filter package. |
After Go 1.13 comes out, we can freely use "forwarding" functions and avoid duplicated definitions since these trivial mid-stack functions should be inlined now: golang/go#8421
The text was updated successfully, but these errors were encountered: