You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Extension causes high cpu load" warning at startup for slow filesystems and large folders #1819
@Ero-Raghav how many folders are in the top 3 levels of your project? And how fast is your machine/disk?
Your profile shows it sometimes taking 100ms to check a folder on disk, and we do this quite a lot while scanning looking for Dart/Flutter projects. It quickly adds up to 3 seconds, which causes VS Code to show this message (which is slightly misleading - it's not high CPU, it's time spent blocking the thread on I/O).
I did some testing on a folder that contains 1088 projects in the top 3 levels, but my times are so fast it's hard to optimise. I tried several other options (including making the search parallel/async and using the glob package) but they were all much slower.
I'll investigate removing some exists checks which did have an improvement, but I'll need more info about your setup to do much more (things that are likely to be a factor are the number files/folders in the top 3 levels of the folder you opened in VS Code, the speed of your filesystem, and whether the filesystem may have been under load while this was happening).
What sort of disk is in the one this occurred on? Is the machine generally really slow to use? I'd like to support as many machines as possible, but the numbers in that trace seem particularly slow (in my test above I scanned thousands of folders to find 1088 projects in 88ms, but your trace shows individual file-exists checks taking over 100ms).
Ok, it does at least seem like it may have had a lot of folders to scan. I'd prefer not to make this code async just to avoid this warning (since it gets slower for everyone) if it's only on slow machines and large folders. I think either you could ignore the message (it's not causing any harm - and despite the text, it's not using high CPU) or try to open smaller portions of your tree.
I will try to eliminate some of the redundant exists checks though, that should help a little.
changed the title [-]Extension causes high cpu load[/-][+]"Extension causes high cpu load" warning at startup for slow filesystems and large folders[/+]on Jul 10, 2019
Activity
DanTup commentedon Jun 25, 2019
Thanks for the report, but you need to attach this file for this to be investigated.
If you saw the issue at startup, I suspect it's #1628 which is fixed for the next version (which you can try out a beta release of from https://github.com/Dart-Code/Dart-Code/releases).
Ero-Raghav commentedon Jun 29, 2019
Same Issue. Dart-Code.dart-code-unresponsive.cpuprofile.txt
DanTup commentedon Jul 8, 2019
@Ero-Raghav how many folders are in the top 3 levels of your project? And how fast is your machine/disk?
Your profile shows it sometimes taking 100ms to check a folder on disk, and we do this quite a lot while scanning looking for Dart/Flutter projects. It quickly adds up to 3 seconds, which causes VS Code to show this message (which is slightly misleading - it's not high CPU, it's time spent blocking the thread on I/O).
DanTup commentedon Jul 9, 2019
I did some testing on a folder that contains 1088 projects in the top 3 levels, but my times are so fast it's hard to optimise. I tried several other options (including making the search parallel/async and using the
globpackage) but they were all much slower.I'll investigate removing some
existschecks which did have an improvement, but I'll need more info about your setup to do much more (things that are likely to be a factor are the number files/folders in the top 3 levels of the folder you opened in VS Code, the speed of your filesystem, and whether the filesystem may have been under load while this was happening).Perf testing...
Ero-Raghav commentedon Jul 10, 2019
@DanTup
It may be possible that it's because of slow HDD, because i never got this problem on my other system which have relatively faster HDD.
DanTup commentedon Jul 10, 2019
What sort of disk is in the one this occurred on? Is the machine generally really slow to use? I'd like to support as many machines as possible, but the numbers in that trace seem particularly slow (in my test above I scanned thousands of folders to find 1088 projects in 88ms, but your trace shows individual file-exists checks taking over 100ms).
Ero-Raghav commentedon Jul 10, 2019
its ATA Hitachi HTS72503 320GB HDD, and Yes its Generally slow to use (mostly when i am using vs-code) because of CPU bottleneck.
DanTup commentedon Jul 10, 2019
And how big is the folder you're opening? (how many folders at the top, 2nd, 3rd levels?).
Ero-Raghav commentedon Jul 10, 2019
around 1.3 GB and there are 16 folder at top level and level 2 and 3 have variable number of folders ranging from 4 to 40
DanTup commentedon Jul 10, 2019
Ok, it does at least seem like it may have had a lot of folders to scan. I'd prefer not to make this code async just to avoid this warning (since it gets slower for everyone) if it's only on slow machines and large folders. I think either you could ignore the message (it's not causing any harm - and despite the text, it's not using high CPU) or try to open smaller portions of your tree.
I will try to eliminate some of the redundant exists checks though, that should help a little.
[-]Extension causes high cpu load[/-][+]"Extension causes high cpu load" warning at startup for slow filesystems and large folders[/+]Perf testing...
DanTup commentedon Jul 10, 2019
I managed to shave around a third of the time off (on my machine) by using
withFileTypesto avoid the extra exists+stat checks:This should improve things but if you (or anyone else) seems to hit this on reasonable disks and/or with fairly small folders, please do shout!
Ero-Raghav commentedon Jul 11, 2019
@DanTup Thank You