-
Notifications
You must be signed in to change notification settings - Fork 325
IntelliJ is becoming unusable, steadily becoming slower and slower as the project grows. #4142
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
Comments
Hi @marcglasberg,
|
@alexander-doroshko I'm not sure I can, since our project is not open source. What kind of private/sensitive information goes into these logs and CPU snapshot? Does in contain source code? |
CPU snapshot - unlikely any personal data. |
Hi, @alexander-doroshko. @marcglasberg asked me to continue this communication. When setting the visibility, I can't find the group "jetbrains-team". Instead, there is:
Which option should I pick? |
|
Thank you for the attached logs and CPU snapshots in the JetBrains issue tracker! We've found lot of useful information there:
|
Thanks very much for your analysis. Regarding this part:
This doesn't seem correct. These take a really long time. For example, that rename of a public field of a private class takes from 2 to 15 seconds in my computer. The whole process I mean. Maybe the rename itself is fast in your logs, but it has to find usages, etc. Do your logs account for the whole process? In more detail: Just to open the rename window it takes some time. I type Shift-F6 and it opens a dialog saying "checking availability at the selection". (by the way, I don't understand this message, availability of what, can you explain?). This dialog takes 2 to 3 seconds to disappear. Then the rename dialog opens. Then after you type the new name it takes some time, one or two seconds, to enable the Ok button. Yes, I have to wait until it enables the Ok button. What is it doing that prevents me to click that button right away? The rename itself, after you click the Ok button seems to be the fast part, and maybe that's what your logs are showing. But the whole process takes a lot of time, and this is proportional to the size of the project. It takes almost no time if the project is small. The toString took more than a minute, is that what the logs show? Find Usages also takes a lot. If the logs don't show that then they are not the best tool to solve this. Maybe a video would be better for you to see the problem. |
Thanks. CPU snapshots don't show time that the IDE spends waiting for the Dart Analysis Server to respond, so slow rename and find usages are probably caused by slow response from the server. Some technical details, just for your interest:
IDE is asking the server whether 'Rename' refactoring is available at the current caret position
IDE is asking server whether the entered name is a valid new name for the field/function/whatever being renamed.
Logs don't show that but I trust you without a video =). It's possible to capture Analysis Server logs that would show how long it takes to handle each request. I think engineers from Google Dart/Flutter team will ask you for the details they need if they are unable to reproduce the issue in a huge project. For the reference, the project that was used to capture CPU snapshots contains ~30000 files (this includes SDK and packages files). |
From an usability point of view it's just terrible that it makes you wait between typing something and pressing the Ok button. The IDE should ask the server after we press the Ok button, not before. And then, only if necessary, it should let you know that it can't proceed because the name is invalid. Even so, how can it take seconds just to check if it's a valid name or not? It's probably checking if there are other variables with the same name. In Java it lets you know that there is a conflict, and gives you the option to proceed if you want. In Dart it just doesn't let you do it, which is bad because sometimes that's really what you want. So I think there are two problems here:
|
If it were fast it wouldn't cause any issues. As we now have the first complaint we'll address it somehow. Well, I'm taking a break to wait for Google to comment on the issue. |
Just to append some information that may be useful, these are some details about the CPU snapshots attached to the issue opened in issue tracker:
|
@marcglasberg, @hugocbpassos, thanks for the report, and @alexander-doroshko, thanks for the detailed investigation! There are a lot of items here. Some thoughts:
|
|
OK, this is a pre-release version of M42 of the plugin. When installed, the version should say something like 'SNAPSHOT'. It'll install into IntelliJ 2019.3; this can be done through the I expect that it will address many of the performance issues, but would definitely appreciate if people could confirm that, as well as let us know of remaining issues. |
* Check if bazel is enabled before attempting to load a workspace to fix slowness in #4142
@devoncarew Sorry for the time it took me to test this. As soon as I updated IntelliJ to 2019.3 I saw an overall speed improvement. This was before installing your plugin. The fact is that the IDE in my computer was slower than Hugo's, and then it became the same. I used it like this for a few days to get used to it, and then installed the plugin. I didn't notice any improvements with the new plugin (but maybe there were, just not very noticeable). This is the situation now:
|
* Check if bazel is enabled before attempting to load a workspace to fix slowness in flutter#4142
For those still having problems try deleting all temp files with something like ccleaner, it might help |
Try adjusting your imports. I noticed that in a project that was using libraries and parts heavily to connect all the imports for all widgets, it took a LONG time. As soon as I removed that and started importing directly, the speed increased. I assume this is because the analyzer doesn't have as many files to look through when looking for suggestions. However, now that we can update imports using smart suggestions (or whatever it's called) this may not solve the issue anymore |
Dart analyzer is using 3gb and has been "analyzing" 1 file for the past 20 minutes, there is no log output. Since its clearly my fault, I should go back to VSCode? Seriously, even when the analyzer does it's job, it is the most unpredictable environment to work in. It feels like someone made a set of tools from a cheap 3d-printer and called it innovative. |
the only workaround for me is binding a hotkey to "restart dart analyzer server", when you try to edit a file which imported from many other files, you should trigger it first and start editing. when you feel it's almost reaching to analyzing done while you are still editing, just trigger restart again... you will get rid of CPU peak... this crazy thing starts from Dart 2.0. and that's hard to reproduce since it only exists in large codebase with many import. (not every file, only for the file that be imported from many other files) it seems like analyzer server doesn't update the cache tree well, and cause the objects leak. so the partial structure tree update will get slower and the tree itself get larger by each update. if you make many file editing and the memory will grow up and never end till out of memory. eventually, I only give the heap size 4GB so if I forgot to trigger restart, at least it will crash only in 4GB. btw, you may need to upgrade your machine to higher performance and more cores. it may..... gets little better. I'm currently using MBP 16 i7 version. also tried 16 i9 version, but no difference. |
Hi, I'm from JetBrains and I work on the Dart plugin for IntelliJ-based products (including Android Studio). Performance problems may look the same but may be caused by completely different reasons. The problem reported in this issue has been thoroughly analyzed and addressed (see #4142 (comment)). So most likely the problems noticed by other people have different nature. In general, there may be 2 types of performance problems:
In any case we'd be happy to analyze each particular problem. To do this we'll need:
You may file an issue right in the JetBrains Issue Tracker (Project: WebStorm, Subsystem: Dart). Logs may contain some sensitive data like project names and file paths. You may attach logs as visible to jetbrains-team only. We'll analyze each problem individually and will either fix it or move to the right place (which could be Dart SDK, Flutter plugin, 3rd-party plugin, etc.) |
Alexander, the Dart plugin for IntelliJ has terrible usability problems that never get fixed. I come from Java development with IntelliJ, and the comparison puts the Dart plugin at some serious disadvantages. Developing for Java is a joy, and developing for Dart is painful. My question: Where is the best place to complain about these usability problems? In this repository, or in the JetBrains Issue Tracker (Project: WebStorm, Subsystem: Dart) ? |
@marcglasberg It's sometimes hard to guess the right issue tracker, sorry.
If you are unsure, feel free to start with the Dart plugin issue tracker or here in the Flutter plugin issue tracker. Both JetBrains and Google handle all incoming requests and redirect to other issue trackers if needed. |
@alexander-doroshko I'm not sure because I cant debug it, but when ITJ starts up, the analyzer runs through like 10 files but hangs on the last file (i waited an hour to be sure) it's locking up on the last file and never finishes. I tweaked the analyzer options to ignore that last file, but it just hangs on some other file. The only way to actually type in ITJ is to literally disable the analyzer. (no disk, memory pressure or cpu use, just dead) Perhaps it would be more wise to focus on stability & reliability first before worrying about performance. I dont care how slow it is if it just does the job every time I ask for it. |
@cyberpwnn This sounds like a critical issue. But it is not known, if I'm not mistaken. So if it's not reported, it will probably not be fixed. According to your comment, the issue is probably related to the Dart Analysis Server and doesn't depend on the IDE/editor that you use. So the right issue tracker would be https://github.com/dart-lang/sdk/issues/ Please file an issue with as many details as you can, including OS, Dart SDK version, project structure. Ideal bug report is the one that contains steps to reproduce and sample project attached. Though I know it's not always possible. Analyzer instrumentation log may help to narrow down the issue with analyzer. To get logs: open Registry (searchable using Find Action ( I'm not from Google and I'm not working on analyzer, so I may help only with initial issue evaluation. But if I manage to reproduce the problem on my end, I'll probably be able to help investigate it. |
Trick that sometimes helps to resolve problems with the Dart Analysis Server: try to close all Dart projects and clear analyzer caches. Mac/Linux: delete Windows: delete |
I also noticed same performance issue when project grows, it's still usable but the difference with a new project is huge. My "big" project is only around 5k lines and performance of the IDE has declined. I'd agree with the author that it's less true with java/kotlin project |
Can this issue please be reopened, if this is the correct place for it? Editing Flutter projects in Android Studio is very slow still. Reinstalled Windows, same issue. |
I'm seeing this issue as well on Mac... |
I would suggest trying the Flutter support for VSCode if you are experiencing performance issues using IntelliJ. Please let us know if you still experience the performance issues when using VSCode. That will help verify that your issues are due to the Dart IntelliJ integration rather than the Dart Analysis Server used by both implementations. |
As my project grows, IntelliJ is becoming unusable. It's been steadily becoming slower and slower as the project grows. I've been watching this get worse and worse for months.
I'd say Flutter tooling is really bad in terms of performance for large projects. We have brand new, extremely fast computers, and yet, it halts all the time, all operations are slow. We're doing simple renames by hand, and stopped using autocomplete, because it just takes 5 seconds or so. Today I turned off inspections, to make it a bit faster. When I open small projects it's really fast. Yes, our project is big, but when I open much larger Java and Kotlin projects the IDE works just fine. Everything is slow: Code completion, refactoring, importing, renaming, searching usages. This is all not at the same level as Java or Kotlin.
For example, if I search for usages of some method, it shows me the usages of all classes with that method name. For example, if I'm in MyClass and search usages of its method map it will show me usages of all Iterable classes, since all of them have a map method. This makes the search very slow, and it's never what I want. I want usages of MyClass.map obviously. And it also shows me dynamic variables with that name. Which is also not what I want. I believe the analyzer is being overwhelmed with all this noise, and it gets slow.
In any case, it seems to me the analyzer is just bad. For example, if I try to rename a private variable it should be fast, right? Just a single file to look at. Yet it takes a lot of time, as if it was searching the whole codebase. This issue is similar to #4012 but that issue was closed, and the problem still persists. In special this is still true for large projects:
"It's slow enough that as I edit code, I can watch the syntax highlighting update about once every two to 15 seconds, which is far to slow to be useful. The suggestions dialog takes 3-4 seconds to show up, and another second or two to populate, sometimes showing the little in-menu spinner for ten seconds before showing any information, and sometimes it just gives up after 20 seconds or so with "No Suggestions" when I know for sure that there are valid suggestions to make."
Also, it may not be just the analyzer. There are also issues when renaming/moving folders with more than 10 files (the number 10 is arbitrary, just a “larger” number of files) either not all references get updated or we’ll get an error saying "Move File Exception - Exception when attempting to compute the file change for the file move: Server error: The edit.getRefactoring request was cancelled."
Flutter surely is amazing, and you guys rock, but I wish Google would pay more attention to the basics. Makes no sense doing wonderful advanced stuff without first making sure the basics are rock solid. What good is having ML autocomplete, while the simple autocomplete doesn't work as it should because it's too slow?
The text was updated successfully, but these errors were encountered: