Skip to content
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

make isprime(::BigInt) use deterministic algo when possible #54

Closed
wants to merge 1 commit into from

Conversation

rfourquet
Copy link
Member

When a BigInt is small enough (n<=2^64 currently), I don't see why it shouldn't use the deterministic algorithm, in particular as it is usually not much slower (and can be faster sometimes).
I also convert signed types to unsigned as it seems to be usually faster (but I tested only on 1 machine!)

@rfourquet
Copy link
Member Author

@oscardssmith I have a hard time finding time to follow the recent discussions in this repo, I see you have multiple open PRs, which one would you like to be reviewed first? And I totally forgot about this open PR you closed here, is it not valid anymore, or is it superseded by another PR?

@oscardssmith
Copy link
Member

I probably should have left a message before closing this, but TLDR is that GMP does this for us. From my brief benchmarking, just calling to GMP is about the same speed as converting first.

Can you review #102 first? It's relatively simple, but a massive speedup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants