-
Notifications
You must be signed in to change notification settings - Fork 300
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
"Extension causes high cpu load" warning at startup for slow filesystems and large folders #1819
Comments
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). |
Same Issue. Dart-Code.dart-code-unresponsive.cpuprofile.txt |
@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 I'll investigate removing some |
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. |
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). |
its ATA Hitachi HTS72503 320GB HDD, and Yes its Generally slow to use (mostly when i am using vs-code) because of CPU bottleneck. |
And how big is the folder you're opening? (how many folders at the top, 2nd, 3rd levels?). |
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 |
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. |
@DanTup Thank You |
Performance
dart-code
3.1.0
Darwin x64 17.7.0
1.35.1
/Users/jordanlesson/Dart-Code.dart-code-unresponsive.cpuprofile.txt
Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load
The text was updated successfully, but these errors were encountered: