Closed pi8027 closed 3 years ago
One thing I don't understand here is that how the original field
could avoid performing the same computation twice with this correctness lemma. I think invoking vm_compute; reflexivity
for the first three subgoals does not really help here since readback (from VM values to Coq terms) and compilation (from Coq terms to VM code) can also be costly.
FTR, this PR clearly makes compilation of apery faster. Maybe I should merge this anyway.
before:
make 789.30s user 11.23s system 99% cpu 13:21.28 total
after:
make 728.98s user 10.67s system 99% cpu 12:19.89 total
As it can be seen in the following type, applying the
Fcorrect
lemma produces 5 subgoals:Before this PR, computation for the shared subterms was performed twice in the last two subgoals. https://github.com/math-comp/algebra-tactics/blob/350523a328b0b06829bea9e66edf2a1792295508/theories/ring.v#L453-L457
This PR fixes this performance issue, but what I do here (see the diff) looks really silly. I hope there is a smarter way to do the same thing... Maybe @amahboubi knows?