-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Improve performance of ilog
and checked_ilog
for primitive integer types
#115874
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Sep 15, 2023
This was referenced Sep 15, 2023
saethlin
added
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Sep 16, 2023
@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 😬 |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 22, 2024
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...)
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Apr 22, 2024
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...)
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 23, 2024
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...)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: