Skip to main content
Code Review

Timeline for Miller-Rabin implementation is very slow

Current License: CC BY-SA 4.0

7 events
when toggle format what by license comment
Mar 15, 2024 at 21:40 comment added vnp When in doubt, profile. Where the code spends most of the time? That said, my first instinct is that gmpy2.powmod(x, 2, n) is a culprit. A simple x = (x*x)% n might be faster. I don't have gmpy2 installed to confirm.
Mar 15, 2024 at 21:07 history edited Sᴀᴍ Onᴇᴌᴀ
edited tags
Mar 15, 2024 at 20:49 history became hot network question
Mar 15, 2024 at 18:26 answer added ShapeOfMatter timeline score: 4
Mar 15, 2024 at 11:30 comment added Lereu @possum yes it does
Mar 15, 2024 at 10:55 comment added user223951 Let me start with "does the code produce the correct output?"
Mar 15, 2024 at 9:05 history asked Lereu CC BY-SA 4.0

AltStyle によって変換されたページ (->オリジナル) /