-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Analysis painfully slow in IntelliJ after update #28383
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
@bwilkerson is the analysis driver on in this version? |
The analysis driver was enabled by 7e560a6. As far as I can see, that means that it was enabled in dev.6.0. |
Could you please provide more details - which folders you have open in IDEA, files of which packages you change, example of a change, what you see. If you see that unrelated files are analyzed, also please provide examples. If files are really unrelated, meaning that their library import/export closure does not include the changed file, then analysis results are served from the cache on the file system. I'd like to verify how it works in your example. As an experiment I opened |
I have pkg/compiler and tests/compiler/dart2js/ open in one "dart2js+unittests" project. Remove/reinserting 'MemberEntity.isAssignable' in pkg/compiler/lib/src/elements/entities.dart trigger reanalysis of pkg/compiler/lib/src/util/setlet.dart and tests/compiler/dart2js/sha1_test.dart (none of the files opened in the editor when doing the change). I normally have two "dart2js+unittests" projects open for two different checkouts of the repository. This sometime confuses the analyser (thinking files from one repo is used in the other). The observations above were made both with one and two projects open at a time. |
Unfortunately I cannot reproduce the performance problem. Start cold: 33242 ms The new analysis server keeps results of analysis cached on disk, in ~/.dartServer/.analysis-driver folder. So, when you rollback some changes to already seen state, analysis results are quickly restored. Could you verify that you have this folder and it has files? Actually pkg/compiler/lib/src/util/setlet.dart and tests/compiler/dart2js/sha1_test.dart DOES depend on the file pkg/compiler/lib/src/elements/entities.dart, see the attach with the transitive closure of files - all 388 of them. What would happen if you try to ignore the fact that analysis is performed in background? |
The .analysis-driver folder exists, currently holding 1.6Mb in 235344 files. Regarding features, some are no longer working; must annoyingly the link from class to subclasses is gone (so I have to search for 'extends ClassName') and the link to overriding methods is also gone. |
FWIW, I really think we need to restore these indicators. I think it's a major usability regression (it certainly is for me). |
Is it worth tarring up this directory so that that Konstantin can take a
look?
…On Thu, Jan 19, 2017 at 8:54 AM, Brian Wilkerson ***@***.***> wrote:
FWIW, I really think we need to restore these indicators. I think it's a
major usability regression (it certainly is for me).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#28383 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACAsW9jgWQntnXfKBOS3TYUWdKLgRZYqks5rT5U7gaJpZM4Li-OQ>
.
|
Do you need more information from me? I'm still seeing these minute long analyses - seriously degrading my work flow. |
If features - errors, semantic highlighting, navigation, completion, search and refactoring work in the current file fast enough, then no. We think that it's OK for background analysis to take time. If features don't work in the current file, then yes, it's a problem. Could you please clarify which is your situation regarding to the current file editing? |
As soon as I start editing it fires of a huge analysis leaving the current file with no assistance - and often with errors "hanging" with a message like "FooMix is not a class..." when long after I have typed the full word "FooMixin". |
Yeah, that's pretty bad. Let's look into details. I need you to turn logging.
Then, when you see a problem with performance, or stale errors, archive both files and deliver them to me with a description what you see. Remove the files and restart Analysis Server to get new files with fresh problems smaller. |
Where should I add the --instrumentation-log-file and --new-analysis-driver-log options? |
Also in |
If I set
the 'Dart Analysis' view remain empty (crashed perhaps?) |
Were either of the log files created? |
No. |
Then I'd try running the server from the command-line to see what output does get produced. |
How? We're the executable? |
You can run server from the command line using
(where I tried the arguments you gave on my machine (modified to match my directory structure) and it worked fine. But I noticed that you passed in a path for the instrumentation log that uses forward slashes rather than backward slashes, even though it appears that you're running on Windows. I suspect that this path is used as a path rather than a URI, so we might well be getting an exception when we try to open that file. |
Apparently both paths have to be of the form |
Does that mean that you got it running? Was there any output? |
Any updates on this? I'm still experiencing similar slowness on Windows 10 (only a single repo inside a single project) |
I'm a bit concerned about the approach of storing analysis in a lot of (small) files (in |
At least on Mac and Linux speed of listing many files in the command line, or the more so in UI tool (which would do a lot more processing, like fetching icons, associations, creating widgets) does not correlate with the speed of opening individual files for writing or reading. So, while it would be possible to implement our own file system in single physical file, I think that the file system service is one of the main tasks for operating systems, and it is not wise to compete with them. The fact that there is a lot of IO might be a sing that there is a lot of analysis done, and results are written to disk. Can you see whether this is mostly read or write? How much bytes are read and how much is written. Analysis Server has in-memory cache for reading, so for not too large projects almost everything what current analysis roots need gets eventually read into memory and we don't perform a lot of reads from disk. OTOH, when we analyze, we have to write new results in order to be able to reuse them between restarts and if in-memory cache overflows. |
Assumed stale. |
This problem on Windows occurs yet. The workaround is delete frequently all files on AppData\Local.dartServer.analysis-driver |
+1 still slow for me on windows10 as well |
Thanks for mentioning this. That folder for me was more than a gigabyte, cleared it out and now the dart analyzing takes about 5 seconds instead 10-15 minutes stalling on a few files. No more slow dart analysis! Added this to my clean command:
|
Reopening. |
That's interesting information. Where is your The whole point of this file system cache is to provide results reasonably fast. Is it a know problem on Windows, that large directories cause problems with opening and reading files from them and / or writing new files? I myself don't see problems with reading / writing / deleting files in large directories under Windows 7. And correspondingly Analysis Server in IntelliJ works fast there. However I don't have Windows 10 to try. |
The directory is on local disk. The full path is: |
I don't know what's going on. Open |
When IntelliJ is opened and the process Directory Timeline (hh:mm:ss) on IntelliJ: 13:13:00 started IntelliJ OPEN PROJECT 1 (default) OPEN PROJECT 2 Environment: Important: The analyzer is slow when IntelliJ is first opened after Windows restarts. If IntelliJ is closed and reopened (without restarting Windows), the parser runs quickly. |
@supermuka I don't have any good solution for this, other than clearing the cache :-( It might be that the solution that works well on Mac and Linux does not work so well on (all? some?) Windows computers. Specifically it might be that having many files in one directory is somehow too heavy for Windows. Or maybe the cache clean up isolate that lists all files in the cache, checks access stamps, and removes old files; that it prevents / radically slows down reading the cache in the main DAS isolate. @zanderso do you have any experience with Windows I/O, or maybe know who worked on Windows I/O in Dart VM? Are there any know pitfalls, conflicts, locks in Windows I/O in Dart? |
It might be also caused by having too many files in a single directory, about I'm going to try perform sharing using two levels of intermediate directories, based on the first and the second letter of keys. All keys are currently MD5 hashes, so this should give even distribution. |
[email protected] Bug: #28383 Change-Id: I177e9bedef79627d7b21e565684004054cef1e54 Reviewed-on: https://dart-review.googlesource.com/c/87521 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
I landed the change that uses one-level, two-characters sharding. Could you download the bleeding edge build of Dart VM and give it a try? |
Yes, in general file IO is slow on Windows, especially in a directory with lots of files. Out of curiosity, though it probably doesn't make a difference, is this directory populated with regular files or symlinks? |
@zanderso Good to know, thanks! The directory has only regular files. |
@supermuka @johnniwinther @kogi Have you tried a bleeding edge build, with sharding analysis cache into multiple directories? Does it make things better? |
More details: microsoft/WSL#873 (comment) |
Thanks, this link has interesting information. Not sure what conclusions I should make from this, and what actions. For example using single cache file with database like page managing in it, so that we don't have to open and close files often, make access time requests, etc. It was really easy to use file system to ensure that read/write operation are atomic, but then I don't work on Windows, so don't feel if it causes any pain. |
I've been away for the holidays and haven't had a chance to test with your
bleeding edge build, yet. However, I checked the cache directory and
confirmed what @gctommy reported. The cache directory was at 1.2+ gigs and
after deleting it, analysis in my project is lightning fast again! It
hasn't slowed down, yet, but when it does, I'll give the bleeding edge
build you posted.
… |
@scheglov, with ~ 88k files in |
I had similar issue with VS Code, it was painfully slow. After each hot reload the whole UI hanged for tens of seconds. It was practically unusable. Deleting all files in |
Having updated IntelliJ to version 2016.3.2, Dart plugin to version 163.11306 and Dart SDK to 1.22.0-dev.6.0
analysis has become painfully slow.
Changes like signature changes or removing/added interface members trigger reanalysis of a huge number of (sometimes completely unaffected) files often taking ~15 seconds, sometimes up to ~1 minute.
The text was updated successfully, but these errors were encountered: