[CP] Cherry-pick for restoring using available declarations for completion #47285
Labels
analyzer-completion
Issues with the analysis server's code completion feature
analyzer-server
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
cherry-pick-approved
Label for approved cherrypick request
commit(s) to merge: 6207d1d
merge instructions: clean (auto)merge
What is the issue: Computing completion suggestions, when the target library imports libraries that have a lot (thousands) of completion suggestions, is expensive.
What is the fix: The fix is to restore using available declarations feature. In short, we pre-compute and send sets of all declarations in any library that we know about, and at completion request we don't send suggestions for these libraries, we only send the corresponding set ID. This way we compute, and transfer 10x less data.
Why cherrypick: Many users impacted, anyone using Flutter.
Risk: low
Link to original issue(s):
flutter/flutter-intellij#5761
/cc @kevmoo @mit-mit @whesse @athomas @vsmenon @devoncarew
Currently
174 ms
to just ask for completion:Currently
426 ms
when typingM
:With CP
7 ms
to just ask for completion:With CP
115 ms
when typingM
:Note, that actual times are even higher because we measured here only times to compute in DAS, but don't include times to transfer data via
stdout
, and time to decode this data in IntelliJ. Without available declarations we these times are proportionally higher, probably pushing total completion time beyond1000 ms
, much longer than the target100 ms
.The text was updated successfully, but these errors were encountered: