Avoid redundant work in diagnostics pass#1514
Conversation
|
Is there any way to encode this statically? E.g. add: And then pass this information to the underlying super-define, so it knows which rules have no diagnostics, and if they in their type try and produce diagnostics, we get a type error? If we are doing the more dynamic approach, I'd definitely want an error asserting that it claimed no diagnostics and there were indeed no diagnostics - otherwise we might accidentally lose a diagnostic, which would be awful. |
I like that much better, thanks for the suggestion! |
d7b65bb to
36fdc17
Compare
7c75bab to
118ff90
Compare
118ff90 to
875b217
Compare
The diagnostics pass is at least O(FRlog(F)) in the number of Files and Rules. While there's no obvious way to improve the asymptotic, we can avoid some wasted work by skipping rules that never produce diagnostics, like
GetDependencyInformation.Turns out that there are quite a few such rules, so the strategy pays off in large projects.