autorewrite, rewrite, rewrite!, and rewrite? are all quadratic in the size of the goal even when there are no occurences #12600
Labels
kind: performance
Improvements to performance and efficiency.
part: rewriting tactics
The rewrite, autorewrite, rewrite_strat, and setoid_rewrite tactics.
Milestone
Description of the problem
Consider this code:
On goals of the form
goal_noop n
, we can followredgoal ()
withautorewrite with rew_fg
,try rewrite !fg
,try rewrite fg
, orrewrite ?fg
. All of these are quadratic inn
:Interestingly, SSReflect's
rewrite
does not suffer from this issue, having performance linear in the size of the goal, and only takes more than a second on goals larger than 106 terms (goal_noop_exp lgn
forlgn
>= 19):(the "cold" line is for a cold cache; the rest are run on the same goal immediately after running the cold-cache one)
This isn't super-high priority, but goals (e.g., in the category theory library) can easily reach upwards of 50,000 terms, and having
autorewrite
take 3 seconds (or more) to do nothing is kind-of slow.What's causing the quadratic behavior here?
cc @ppedrot @mattam82
Coq Version
8.11
The text was updated successfully, but these errors were encountered: