-
Notifications
You must be signed in to change notification settings - Fork 498
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
Constant CPU load #1464
Comments
What happens if you disable script analysis with the setting |
Thanks for your quick reply. Unfortunately, disabling script analysis does not help. CPU load is still high although the script has finished running. |
@ya-alexander This issue may have some more information: #1174 (comment). Does disabling CodeLens help? |
@rjmholt Thanks a lot. I tried disabling CodeLens and, at least for now, can confirm that it helped a bit. Windows PowerShell is still using 6-8% of CPU, but that is way less than the > 15% before. Do you have any more tips like that :-) |
I've been having a similar issue when working on a 3000-line script with one hyper-threaded core from my 2-core laptop regularly nailed at 100% on a PowerShell process under VSCore and very laggy performance. I also noticed that the status bar almost constantly had 'Formatting PowerShell document...' running. Disabling CodeLens helped, but not a great deal. Disabling script analysis has made a massive difference. |
Yeah disabling ScriptAnalysis is the other tip. It looks like different features are performance bottlenecks on different machines. If anyone is hitting an issue like this, try disabling individual features (should be similar to how CodeLens is disabled) and report back here -- it's much easier for us to determine the cause of performance issues with information like that on hand. |
I think i might be seeing the same issue. I just filed #1503 for PowerShell using a large amount of CPU. Let me know if i can do anything to assist with debug/repro. |
@dpaulson45 Can you try disabling script analysis and tell us what you find? Then re-enable it and try disabling CodeLens. Then disable both. And report back on what effect each has? Thanks! |
@rjmholt after disabling script analysis the CPU issue doesn't occur after i reload Visual Studio Code. CodeLens doesn't appear to matter if this is enabled or disabled. |
Related issue here, very high memory consumption (4GB) when running VS Code Insiders (latest). The only thing I use it for is developing PowerShell scripts. When checking the The weird thing is, I'm not even running code when the memory is high. The PowerShell terminal in VS Code is just sitting there doing nothing while the memory is still being consumed by PowerShell as appears in the |
Related issue, |
My #1648 was closed and referenced here, however it seems that my issue is completely unrelated to this. |
Since my other was closed, I'll comment here. It appears that when using import-pssession with a -prefix |
Same thing here. Fresh start of VScode, the "integrated console" is immediately using 25% CPU. ProcessEpxlorer shows that it is constantly opening and closing threads. Memory usage is increasing slowly but constanly. |
Same issue. 8th gen i7, 35-40% CPU load for several minutes when I start vscode or switch .ps1 files. Disabling CodeLens had no noticeable effect whatsoever; but my projects are very compartmentalized and it seems the effect scales with reference complexity. Also worth noting, my terminal does not render until I start typing. |
Please update to PSScriptAnalyzer 1.18.0 and see if the problem persists.
You need to restart VSCode (or at least the PowerShell session) after executing this command. |
Yep that fixed it for me. |
@Hypernut same experience here: It's in two different folders, that's probably why. |
I think the one in the extension-folder only gets updated when the powershell extension as a whole gets updated. But that would also mean the powershell console in vscode uses a different module than the editor in vscode? |
Running the command @rkeithhill (edit: I referenced wrong user) gave made no change--in fact, the test was significantly worse, but I think there's just an extreme amount of variability in behavior here. Yes, I restarted vscode after running it. |
@cmcit-bferg |
@Hypernut Like the others, I have 1.18.0 in my path, but 1.17.1 in home\.vscode\extensions... |
Correct
They both should be the same - 1.18. The one that the editor uses is loaded into runspace 4 which you cans see by running this |
The basic idea is that the extension will use the latest version you have installed but it does provide a version in case you don't have any version installed. |
After update, CPU usage spikes a little higher than before but for a much shorter period of time. VSC is now using PSScriptAnalyzer 1.18.0 |
To address questions about where and how PSScriptAnalyzer is loaded:
|
And to check which version of PSScriptAnalyer got loaded for in-editor analysis, run this command: |
Going to close this as a result of the major architectural changes we made in the omnisharp port. |
Issue Type: Performance Issue
Hi,
whenever I run a PS script in VS Code, the CPU load keeps staying at around 15-20% although the execution of the script already finished. It seems that Windows PowerShell is causing the actual load. Do you have any tips to remedy that behavior?
Thanks,
Alex
Extension version: 1.8.2
VS Code version: Code 1.25.1 (1dfc5e557209371715f655691b1235b6b26a06be, 2018-07-11T15:43:53.668Z)
OS version: Windows_NT x64 10.0.17134
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: