-
Notifications
You must be signed in to change notification settings - Fork 664
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
Optimize list constructions in micromega #10745
Conversation
We prevent reallocating a lot of lists by threading the result of a fold function inside an accumulator. Includes the Micromega bootstrap.
This part of the code has no theorems about it, so it is more perilous to to preserve the same behaviour as before. Accumulator logic is bad for your brain. Also includes a Micromega bootstrap.
Bench shows nothing interesting.
I guess nobody is using Lia in extreme cases. |
bedrock2 is missing in the benchmark, I guess that's because at the time this bench was run, our build was failing, but now it should work again, according to the ticks of our own CI. But I think bedrock2's current code would not run faster, because we avoid using lia in these extreme cases. @andres-erbsen built his own abstract interpretation based on intervals for this, but it would really be great to be able to call lia without having to worry wether it will run fast enough or not. And in fiat-crypto, if I understand correctly (/cc @JasonGross), it would simplify the proofs scripts if they could run So to summarize, I guess the reason nobody is using Lia in extreme cases is that Lia doesn't work in extreme cases at the moment. |
I have a hard time rebasing this after the merge of the zify PR. I might try reimplementing it from scratch. |
Closing the PR in the meantime. |
This PR reduces the number of list allocations in Micromega by using accumulators. On the example from #10743, the failure time is divided by almost 2, from ~18.5s to ~10.5s. There is probably a way to optimize even better, but for the time being this looked like a nice enhancement.
Bench running here.