Skip to content

std.numeric: Always use Stein's algorithm for integral gcd()#7976

Merged
dlang-bot merged 1 commit intodlang:masterfrom
ibuclaw:numeric/gcd_stein
Apr 17, 2021
Merged

std.numeric: Always use Stein's algorithm for integral gcd()#7976
dlang-bot merged 1 commit intodlang:masterfrom
ibuclaw:numeric/gcd_stein

Conversation

@ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Apr 17, 2021

Whatever tests/observations were done in #4940 no longer apply when I run benchmarks locally:

ubyte_euclid: 10 secs, 741 ms, 853 μs, and 9 hnsecs
ubyte_stein: 6 secs, 98 ms, 939 μs, and 7 hnsecs
ushort_euclid: 13 secs, 442 ms, 495 μs, and 6 hnsecs
ushort_stein: 9 secs, 266 ms, 581 μs, and 2 hnsecs
uint_euclid: 13 secs, 285 ms, 480 μs, and 4 hnsecs
uint_stein: 9 secs, 173 ms, 414 μs, and 8 hnsecs
ulong_euclid: 20 secs, 227 ms, 886 μs, and 2 hnsecs
ulong_stein: 9 secs, 181 ms, 300 μs, and 8 hnsecs

@ibuclaw ibuclaw requested a review from andralex as a code owner April 17, 2021 10:41
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#7976"

@ibuclaw ibuclaw force-pushed the numeric/gcd_stein branch from a868f32 to f8e6a29 Compare April 17, 2021 10:46
@ibuclaw ibuclaw changed the title std.numeric: Always use Stein algorithm for gcd() std.numeric: Always use Stein's algorithm for integral gcd() Apr 17, 2021
@ibuclaw
Copy link
Member Author

ibuclaw commented Apr 17, 2021

@thewilsonator - Reverted the document change, as Euclid's algorithm is still used in the BigInt overload (tested with CrippledInt).

@dlang-bot dlang-bot merged commit 1bbff45 into dlang:master Apr 17, 2021
@ibuclaw ibuclaw deleted the numeric/gcd_stein branch April 17, 2021 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants