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

Performance optimizations #4

Open
DemiMarie opened this issue Nov 24, 2018 · 6 comments
Open

Performance optimizations #4

DemiMarie opened this issue Nov 24, 2018 · 6 comments

Comments

@DemiMarie
Copy link
Contributor

There are probably optimizations to be made, both in terms of micro-optimization, and in terms of the algorithms used.

@afck
Copy link
Collaborator

afck commented Nov 26, 2018

We should also add some benchmarks, similar to the ones in threshold_crypto, but maybe more deterministic ones.

@DemiMarie
Copy link
Contributor Author

Perf is utterly useless on my system ― it records almost all of the time being spent on GMP internals with no detailed information. I suspect that parts of GMP are missing frame unwind information.

@DemiMarie
Copy link
Contributor Author

I should probably report this as a bug in Fedora’s GMP.

@DemiMarie
Copy link
Contributor Author

Some good news is that all but a few percent of the time is spent in GMP, and very little is spent doing memory allocation. So the performance is probably close to optimal.

@DemiMarie
Copy link
Contributor Author

It might be possible to optimize even more by switching to low-level GMP calls. The guts of GMP are written in assembler, but the convenience functions could be ported to Rust and then inlined.

@afck
Copy link
Collaborator

afck commented Nov 29, 2018

Sounds good! Yes, I guess perf isn't that useful for now then.
I'd add benchmarks and then look at potential higher-level optimizations. (Questions like: Do we need to reduce in every step? Are there faster algorithms to compute the same proofs? Can we reduce the number of GMP calls somehow?) With benchmarks, we'll also be able to get more precise numbers if we want to try out a different bignum implementation.

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

No branches or pull requests

2 participants