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
Option to increase performance: do not filter out absurd clauses automatically #6434
Comments
This makes sense to me. However, the flag does not only affect performance, it also affects semantics, so I don't think it should be called |
Ah, I already wondered about the absence of bikeshedding, since I read your comment on #6435 first. Now the world is back in its usual state... ;-) Let's discuss the name at #6435. |
Have you tried to type-check the standard library with
|
Good questions. I would assume the speedup is noticeable if you have complicated left-hand sides. |
Would an alternative to this option be to infer absurd clauses only if the coverage checker complains? (Perhaps this can be implemented in a smart way without too much recomputation.) In that case one could perhaps get a speedup without having to use this flag. The flag |
Or is this what is currently implemented (more or less)? In that case I would not expect that the standard library experiment that I suggested above (adding |
Well if the coverage checker finds uncovered lhss, it tries to discharge them as absurd. |
The standard library does now make use of this feature, with it being particularly useful in |
For my library equality I got the following numbers:
In this case manual insertion of absurd clauses does not seem to have had much of an effect, except that, in my opinion, the code became uglier. I suggest that we give recommendations for when it might make sense to try turning off inference of absurd clauses:
Perhaps Agda could even warn if a lot of time is spent on, say, case-splitting. |
The cases where inserting absurd clauses have had a significant improvement all spent a lot of time on the part of type-checking where the whole definition is highlighted. In the file mentioned above, it spent ~15 s in this state compared to <1 s with the absurd clauses added. |
Agda 2.6.0 saw an UX improvement: Agda could now filter out missing clauses (in case splitting and coverage checking) that could be shown absurd by further splittings.
However, @oskeri reports a 33% typechecker speedup for one of his Agda files (from 30sec to 20sec) by inserting the absurd clauses manually.
Consequently, the user should be able to opt out this potentially expensive аппара́тчик.
I suggest a new option
--performance:absurd-clauses
.This option would switch off the step in the coverage checker that filters said absurd clauses. Consequently, the respective step in the interactive case splitting should be switched off at the same time.
Relevant code to disable by this option:
agda/src/full/Agda/TypeChecking/Coverage.hs
Lines 170 to 174 in bb3602f
agda/src/full/Agda/Interaction/MakeCase.hs
Lines 416 to 420 in bb3602f
The text was updated successfully, but these errors were encountered: