-
Notifications
You must be signed in to change notification settings - Fork 146
flint: perf: use mpoly for sparse univariate computations #729
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
base: master
Are you sure you want to change the base?
Conversation
|
I'm not sure if users should be able to choose the threshold, but in principle, it could be a setup parameter that they can adjust if needed. |
|
Right, this is an option. For the record, forcer and minceex are ~25% slower if you just force the use of mpoly always. |
4adf7b0 to
b79cc4c
Compare
|
Updated, the term counting was not correct in fact. I ran a few benchmarks also for |
This improves performance for things like "gcd_(1-x^20,1-x^1000000)" since FLINT poly has a dense representation whereas mpoly is sparse. "Real life" benchmarks such as forcer or minceex are unchanged, they have dense polynomials.
|
Updated, remove the "dummy variable" which forces the use of mpoly in sparse univariate scenarios. It is a performance improvement for mpoly routines to not have the un-used dummy variable in their context. Edit: actually I had my numbers back to front. Removing the dummy variable before creating flint contexts seems to cause that to take significantly more time, for some reason. For now I will just leave the dummy variable there. These cases are really not important for real physics computations anyway. |
This improves performance for things like "gcd_(1-x^20,1-x^1000000)" since FLINT poly has a dense representation whereas mpoly is sparse. "Real life" benchmarks such as forcer or minceex are unchanged, they have dense polynomials.
Any thoughts on this? I have determined the threshold "experimentally" by benchmarking
gcd_(1-x^20,1-x^N)for a range ofN. Of course different computations probably have a different threshold... this kind of heuristic usually has tricky cases.