-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve performance of ilog
and checked_ilog
for primitive integer types
#115874
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
Comments
@FedericoStra In case you didn't know, it seems that you closed the related pull request. |
Ooops... Yes I had some troubles forking and cloning the repository (possibly slow connection) and I did something wrong. Thanks for telling me! |
New PR: #115913. I'll make sure not to accidentally close the new one this time 😬 |
checked_ilog: improve performance Addresses rust-lang#115874. (This PR replicates the original rust-lang#115875, which I accidentally closed by deleting my forked repository...)
checked_ilog: improve performance Addresses rust-lang#115874. (This PR replicates the original rust-lang#115875, which I accidentally closed by deleting my forked repository...)
Rollup merge of rust-lang#115913 - FedericoStra:checked_ilog, r=the8472 checked_ilog: improve performance Addresses rust-lang#115874. (This PR replicates the original rust-lang#115875, which I accidentally closed by deleting my forked repository...)
Closed by #115913. |
Currently
checked_ilog
is implemented with iterated divisions:rust/library/core/src/num/int_macros.rs
Lines 2475 to 2495 in e7f9f48
It's pretty straightforward to convert it to iterated multiplications:
and this results in some decent speedups (1.5x - 7x).
The text was updated successfully, but these errors were encountered: