-
Notifications
You must be signed in to change notification settings - Fork 27
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
Documentation, naive_count_32 vs naive_count #71
Comments
Per a I'm not sure I actually want to document this, since performance is so temperamental given its reliance on compiler behaviours of the month. |
Without that information, how can I be expected to make a choice between the two alternatives? Short of running my own benchmarks, and that's way too much effort in most cases. Just having that one data point gives me good information. |
As @Veedrac said, this pretty much relies on compiler behavior, which can be a fickle beast. So you should run your own benchmarks before deciding to risk overflow for unknown gains. |
It's worth adding that, should you go this route, you need to also re-run the benchmarks each compiler update to track regressions. It is a lot of effort to rely on the optimizer in a safe and reliable way. |
Closing wontfix. I am sympathetic to wanting guidance in the documentation, but in this case, if you haven't benchmarked your code as integrated, then I would be much more comfortable if you just use the one that is more correct for the context. |
These two functions are presented, with naive_count_32 having the weakness that it can overflow. That's a trade-off I might be happy to make, but the documentation doesn't say what the performance difference is. Could that be added, at least in one benchmark, to enable a more informed decision?
The text was updated successfully, but these errors were encountered: