-
Notifications
You must be signed in to change notification settings - Fork 325
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
The IDE code completion is more slow on flutter SDK 2.5 #5761
Comments
Hi @luckysmg, Thanks for filing the issue I could not reproduce the issue, When I hit Screen.Recording.2021-09-09.at.4.30.21.PM.movAlso no issue selecting the suggestions Screen.Recording.2021-09-09.at.4.38.50.PM.movLet me know if I am missing anything. flutter doctor -v
|
emm,If I write code from nothing,it will be slow..... here is the video 2.2.3: 2.2.3video.mp42.5: 2.5video.mp4 |
Thanks for the video @luckysmg, I can reproduce it on the stable 2.5 and see a delay, initially, I thought this is the IntelliJ Plugin issue, but since the flutter version is showing the difference this is probably an issue with the tooling,
flutter doctor -v
|
Thanks @maheshmnj . A +1 from me here. I was using Flutter 2.2.1 which was a little bit slow but 2.5 is making intellisense and code completion unusable (its easier to type in the results). I do have a large project but it was kind of ok previously. |
Encountered the same issue(seems OK on vs code), is there any solution for it? |
/cc @jacob314 |
Yes, assigned to myself. I will chat with Brian and figure out what has changed in the completion algorithm to fix this. |
From running this locally on a helloworld flutter app (flutter master; dart plugin 212.4746.57; IntelliJ 2021.2 CE):
Assuming that the end-to-end times come in where I suspect they are, I think it's safe to say that most dart and flutter developers now see completion times above 1 second. |
We are only computing and sending back ~3000 results, which while high, doesn't seem too bad (I was expecting high decoding costs due to 5k-10k results or something). It would be worth looking at what's being sent back over the wire; is each completion entry expensive - are we sending an unexpected amount of data? |
We're seeing some additional evidence of this from Twitter, with a number of reports / corroborations in this thread: https://twitter.com/MatthewRideout/status/1439972286883315712 |
Just to say that my problem was mostly remedied after I allocated more memory to IntelliJ |
I have been looking into this issue and believe that I have a proposal to fix it. Working with @jacob314 to figure out a path forward to staff the work and get the SDK patched. |
Great to see that this is getting attention. I think the sluggishness has been an ongoing issue for a while now, even before this release. VSCode seems to be faster than IntelliJ regarding code completion and code analysis, at least on previous versions. |
@atreeon how much? I've got 8GB allocated, of which only 1 is used, and it's just as slow as shown in the videos above |
@Lootwig I've got 4GB allocated, if you've got 8GB specified it won't be that! (I've seen it go up to about 1.8gb and mine was previously around 800mb or seomthing like that). Mine is just as slow as in the video but a lot better than it was previously. Interestingly it is slow in a Flutter project but ok in Dart. |
Re-assigning to Konstantin who is putting together a PR. |
This reverts commit 3cc518b. Initial CL: https://dart-review.googlesource.com/c/sdk/+/201021 Bug: flutter/flutter-intellij#5761 Change-Id: I62e57deef819f78f1d08934ad924585eaa52223b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214225 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Jacob Richman <jacobr@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Some experiments.
|
Note, that this is not what users could get right now, but just what could be achieved. All completions above were for already resolved file, just typing
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void f() {^
print(42);
} As a result, even with filtering performance is not great. It would have been even worse (on about Fortunately it could be improved so that completion in the trivial code like above is about |
Same as #5761 (comment), but if keeping unaffected library elements: |
For a small analyzer library the time to analyze it 100 times, each time changing that file that we are analyzing, so simulating typing in this file, goes from 1000 ms to 100 ms; for a bigger library 2400 vs 800 ms. For a tiny Flutter hello_world the difference is 100x, 5800 vs 50 ms. Bug: flutter/flutter-intellij#5761 Change-Id: I15c43f4cd66399788ffe6032c52fb365665de7f8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214502 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This reverts commit 3cc518b. Initial CL: https://dart-review.googlesource.com/c/sdk/+/201021 Bug: flutter/flutter-intellij#5761 Change-Id: I62e57deef819f78f1d08934ad924585eaa52223b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214225 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Jacob Richman <jacobr@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov it's my understanding that this is fixed in the main/dev channel (as we reverted in dart-lang/sdk@6207d1d), and is being fixed in stable (via cherry-pick dart-lang/sdk#47285), so can this issue be closed? |
I thought this was me only.... I found out that invalidating caches and restarting sometimes fixed the problem for such a session! This would happen 2 out of roughly 6 times.. |
Yes, we can close this issue. |
Ideas when Dart 2.14.3 will be included with Flutter Stable? Edit: it's out 👍 |
Flutter plans to update the DART version when |
This is now available in Flutter stable, version 2.5.2. |
The IntelliJ Dart plugin needs to be updated in order to get this fix. Is that right? |
@SametSahin10 the change is in the SDK. Upgrading Flutter to v2.5.2 (by running |
The problem still exists at least on IntelliJ platform. I've raised another issue regarding this. |
i'm losing hope, i have a ryzen 7 4800h and 16gb ram, ssd, thermals all fine and android studio is very slow |
@ldsouza93 sorry to hear that you are having issues. This is a closed, year old issue. Can you kindly file a new issue, and detail what versions you are using, and what you are experiencing? |
@ldsouza93 Yes, sorry to hear you are experiencing a slow developer experience. Yes, do create a new issue with more information. With your project in VS Code, with the same analysis server, do you experience the same slowness? |
My IDE is Idea
I have tried many times.
When i switch to flutter SDK 2.5,the code completion tip will take more time to come out...
But when I switch to flutter SDK 2.2.3,it come out very quickly....
flutter doctor:
The text was updated successfully, but these errors were encountered: