Skip to content
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

"edit.getFixes"/"edit.getAssists" can be slow and called a lot by IntelliJ/Android Studio #60292

Open
DanTup opened this issue Mar 10, 2025 · 2 comments
Labels
area-devexp Developer experience items (DevTools, IDEs, analysis server, completions, refactorings, ...). model-performance Performance/memory issues in analyzer/cfe type-performance Issue relates to performance or code size

Comments

@DanTup
Copy link
Collaborator

DanTup commented Mar 10, 2025

There are multiple performance issues coming up in #55281 which makes it a bit hard to track them (and their solutions), so I'm adding sub-issues for some individual issues that have been identified.

One issue is that IntelliJ/Android Studio can call edit.getFixes and edit.getAssists quite frequently, and sometimes these requests can be slow and back the server up.

@jensjoha added some notes about this at #55281 (comment) and has added some debouncing at https://dart-review.googlesource.com/c/sdk/+/413682, however I think this request is also taking too long and it might be that the client should also have some delay/debouncing to avoid so many requests while typing?

An example of how this appears in the diagnostic repo can be found attached to #55281 (comment), which contains slow requests like below (notice they appear to be taking around 500ms each and being sent repeatedly at around the same interval):

Image

@DanTup DanTup added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Mar 10, 2025
@johnniwinther johnniwinther added area-dart-model Use area-dart-model for issues related to packages analyzer, front_end, and kernel. model-performance Performance/memory issues in analyzer/cfe and removed area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Mar 10, 2025
@bwilkerson
Copy link
Member

@johnniwinther Not sure why this is area-dart-model; it looks like most or all of the work for this issue is in the server.

One of the other things we can do in this space is to improve the performance of edit.getAssists. I was talking to @pq a couple of days ago and suggested that we might be able to use an approach similar to the one we use for fixes to reduce the number of CorrectionProducers we are required to run for a single request. (Basically, use a table keyed by AST node class, similar to the way fixes are keyed by diagnostic code.)

A similar approach could be used for refactorings and snippets if either of those ever appear to be taking too long to compute.

@johnniwinther
Copy link
Member

Ok. I'll move it to area-devexp. I added the model-performance label to group this issue with other performance related work currently ongoing.

@johnniwinther johnniwinther added area-devexp Developer experience items (DevTools, IDEs, analysis server, completions, refactorings, ...). and removed area-dart-model Use area-dart-model for issues related to packages analyzer, front_end, and kernel. labels Mar 10, 2025
@pq pq added the type-performance Issue relates to performance or code size label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp Developer experience items (DevTools, IDEs, analysis server, completions, refactorings, ...). model-performance Performance/memory issues in analyzer/cfe type-performance Issue relates to performance or code size
Projects
None yet
Development

No branches or pull requests

4 participants