rust/library/core
Matthias Krüger bc9c31df69
Rollup merge of #122884 - mzabaluev:pow-remove-exit-branch, r=Amanieu
Optimize integer `pow` by removing the exit branch

The branch at the end of the `pow` implementations is redundant with multiplication code already present in the loop. By rotating the exit check, this branch can be largely removed, improving code size and reducing instruction cache misses.

Testing on my machine (`x86_64`, 11th Gen Intel Core i5-1135G7 @ 2.40GHz), the `num::int_pow` benchmarks improve by some 40% for the unchecked operations and show some slight improvement for the checked operations as well.
2024-08-13 21:11:12 +02:00
..
benches Reformat use declarations. 2024-07-29 08:26:52 +10:00
src Rollup merge of #122884 - mzabaluev:pow-remove-exit-branch, r=Amanieu 2024-08-13 21:11:12 +02:00
tests Auto merge of #128742 - RalfJung:miri-vtable-uniqueness, r=saethlin 2024-08-13 04:32:34 +00:00
Cargo.toml Cleanup bootstrap check-cfg 2024-06-27 11:30:03 +02:00