-
Notifications
You must be signed in to change notification settings - Fork 14
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
alg: extremely slow for 3000+ bit exponents #60
Comments
Generate a CPU profile following #88.
It seems that all the time is in |
Yeah, this is bad: Lines 47 to 61 in 9396c1b
The addition chains for these exponents are 3000+ long, so a quadratic algorithm is slow, and cubic is extremely slow: Lines 38 to 42 in 9396c1b
|
The |
A few things help with the optimization of
These optimizations have helped massively with general performance, but it still takes forever for the 3072-bit exponent. Although it does terminate now, it appears to get stuck. Can |
Bryan Mills offered a crafty idea for optimizing https://gophers.slack.com/archives/C0VP8EF3R/p1619665998077200 |
Implement comprehensive profiling options in the search subcommand, using the https://github.com/mmcloughlin/profile module. Profiles are configured with the ADDCHAIN_PROFILE environment variable. Removes the `-cpuprofile` option. Updates #60 Updates #25
) By far the largest number of allocations comes from the creation of bigvector basis vectors. These just contain zeros and ones. This PR changes the Vector type to an interface so that the basis type can be implemented without any allocations at all. Unfortunately, this does complicate the interface, since it requires the user to not write to any integers returned from Idx(). Consider this okay since it's an internal package. Updates #60 Updates #25
Various changes led to a massive speedup.
|
The changes that made the difference: 23389d5 optimize Chain.Ops() (#99) Supporting code: 10bb4ec alg/ensemble: benchmark (#97) Updates #25 |
addchain search '2^3072 - 1103717'
takes an extremely long time, and in fact appears to get stuck.See https://gophers.slack.com/archives/C6WDZJ70S/p1614191115020200 for more context.
The text was updated successfully, but these errors were encountered: