Vscode-powershell: Decreased performance in the last couple months in large modules

Created on 25 Aug 2018  Â·  18Comments  Â·  Source: PowerShell/vscode-powershell

Issue Description

I don't know when exactly it started, but at some point in the last few months performance greatly went down for a large file I'm working with (>6k LOC).
Specifically, formatting speed is so slow I rarely use it anymore. Autocomplete is often quite slow that I've stopped relying on it so much as well.

I appreciate what you guys are doing! I'm happy to help in any way I can.

Attached Logs

Verbose logs:
logs.zip

Environment Information

This happens on two computers I use, one with a i7-5820k / 32GB ram, another with i7-8086k / 64GB ram. Both Windows 10 Pro

Visual Studio Code

| Name | Version |
| --- | --- |
| Operating System | Windows_NT x64 10.0.17134 |
| VSCode | 1.26.1|
| PowerShell Extension Version | 1.8.3 |

PowerShell Information

|Name|Value|
|---|---|
|PSVersion|5.1.17134.165|
|PSEdition|Desktop|
|PSCompatibleVersions|1.0 2.0 3.0 4.0 5.0 5.1.17134.165|
|BuildVersion|10.0.17134.165|
|CLRVersion|4.0.30319.42000|
|WSManStackVersion|3.0|
|PSRemotingProtocolVersion|2.3|
|SerializationVersion|1.1.0.1|

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)

|Extension|Author|Version|
|---|---|---|
|azure-account|ms-vscode|0.4.3|
|bash-beautify|shakram02|0.1.1|
|better-toml|bungcip|0.3.2|
|bracket-pair-colorizer|CoenraadS|1.0.59|
|code-beautifier|michelemelluso|2.1.0|
|code-settings-sync|Shan|3.0.0|
|csharp|ms-vscode|1.15.2|
|gc-excelviewer|GrapeCity|2.1.26|
|githistory|donjayamanne|0.4.2|
|Go|ms-vscode|0.6.88|
|hopscotch|idleberg|0.2.2|
|json-tools|eriklynd|1.0.2|
|language-liquid|neilding|0.0.3|
|Lua|keyring|0.0.9|
|material-icon-theme|PKief|3.5.3|
|Material-theme|zhuangtongfa|2.15.4|
|minify|HookyQR|0.3.0|
|mssql|ms-mssql|1.4.0|
|pdf|tomoki1207|0.3.0|
|PowerShell|ms-vscode|1.8.3|
|project-manager|alefragnani|8.0.0|
|python|ms-python|2018.7.1|
|rainbow-csv|mechatroner|0.4.2|
|RustyCode|saviorisdead|0.19.1|
|shopify-liquid-preview|kirchner-trevor|1.0.2|
|tcl|rashwell|0.1.0|
|theme-glacier|Tyriar|0.0.10|
|theme-happy-hipster|zadvorny|2.8.5|
|vsc-travis-ci-status|felixrieseberg|1.1.0|
|vscode-autohotkey|slevesque|0.2.2|
|vscode-docker|PeterJausovec|0.1.0|
|vscode-great-icons|emmanuelbeziat|2.1.41|
|vscode-liquid-snippets|killalau|1.1.1|
|vscode-scss|mrmlnc|0.6.2|
|vscode-sort-json|richie5um2|1.13.0|
|vscode-todo|MattiasPernhult|0.8.0|
|vscode-yaml-validation|djabraham|0.0.1|
|vsliveshare|ms-vsliveshare|0.3.577|
|xml|DotJoshJohnson|2.3.2|;

Area-Threading Issue-Performance

Most helpful comment

Note that with https://github.com/PowerShell/PSScriptAnalyzer/pull/1166 we expect another speed boost (twice the speed) in PSSA and we plan to release it to the wild soon (hopefully this month)

All 18 comments

Thanks for this! As mentioned on Twitter, we've been investigating a bunch of performance related issues.

Quick question though, in addition to the large file, do you open workspaces with a ton of files?

Yes actually. Here's cloc output:
image

@jahands Does turning off CodeLens help? Let us know if it does and by how much.

Not it does not. I've been using Code a lot for PS the last few days and
everything is still quite slow.

On Sat, Aug 25, 2018 at 12:55 PM Robert Holt notifications@github.com
wrote:

@jahands https://github.com/jahands Does turning off CodeLens
https://github.com/PowerShell/vscode-powershell/issues/1174#issuecomment-379232062
help? Let us know if it does and by how much.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/PowerShell/vscode-powershell/issues/1497#issuecomment-415986104,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKOQXUY1z2uTZiAEP_25zfPcGhRHdC55ks5uUY-JgaJpZM4WMcXn
.

@jahands just out of curiosity. Whens the last time you killed all open vscode windows and restarted it?

It's been a few days, probably a week on that PC actually

On Wed, Aug 29, 2018, 6:06 PM Tyler James Leonhardt <
[email protected]> wrote:

@jahands https://github.com/jahands just out of curiosity. Whens the
last time you killed all open vscode windows and restarted it?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/PowerShell/vscode-powershell/issues/1497#issuecomment-417135691,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKOQXeVN-QT_qc2YSuNWy5SZwmogMBbVks5uVx5mgaJpZM4WMcXn
.

Does disabling script analysis help: "powershell.scriptAnalysis.enable": false?

Just had a look through the changes over the last few months (https://github.com/PowerShell/PowerShellEditorServices/commits/master) and there's nothing there that I can imagine causing serious performance degradations:

  • Using the named pipe transport -- shouldn't change anything
  • Fixed up our usage of the PSScriptAnalyzer module (by version) -- no significant extra processing there
  • Changed the logging to Serilog -- used widely enough that it should be performant, and it's asynchronous anyway

I thought maybe it was time to split code out to multiple files so I moved a few classes to a new file. Formatting still took a really long time. But every now and again formatting will happen almost instantly like it used to. But then formatting again a little later is slow.

@jahands Have you noticed any performance improvement with the latest release?

@rjmholt I think this was partially what I fixed in PowerShell/PSScriptAnalyzer#1074. Once that makes it into a release we should see a significant performance boost in a lot of scenarios.

@SeeminglyScience I'm happy to see that PR.

@rjmholt The format does go slightly faster, like 20 seconds instead of 50+. But it's still a long way from the <2 seconds it used to take.

@jahands See the comment above -- so far as we can tell, this particular performance regression occurred when no large changes went into PSES, so we think it was on the PSScriptAnalyzer side. @SeeminglyScience has merged a fix there, so we are now waiting on a release from them to get it downstream.

@TylerLeonhardt I believe I see this one. Even with codelens off. In the past, I've had the issue even with psscriptanalyzer off, but haven't tried that in a while. I will try that tonight or in the morning.

I have this problem even in relatively small modules\repos (maybe 10-20 functions) and in non workspaces and workspaces. For me, I have done tests where I've waited 10+ minutes for intellisense to finally return results. For me though, this problem has been present for well over a year. I was debugging this with @Daviwil for a really long time well before he ever went to github. The best I could do was disable codelens, but even then it was still unusable.

This could potentially be different issues, but the results have always been the same for me. I really haven't been able to use intellisense for the last couple years.

I've thought it could maybe be something in my environment, but after spending months trying to remove things from my modules that I thought might cause problems, still had the same results. I was removing dynamic params, argument completers, unused modules, cleaning up profiles, etc but never did find anything that made it better.

Note that with https://github.com/PowerShell/PSScriptAnalyzer/pull/1166 we expect another speed boost (twice the speed) in PSSA and we plan to release it to the wild soon (hopefully this month)

Hey just wanted to let let you all know that VS Code is now working really
well with my large 6k+ LOC files. Autocomplete is fast, and formatting only
takes 4-5 seconds (vs minutes or never finishing.)

Thanks!

On Tue, Mar 12, 2019 at 4:16 PM Christoph Bergmeister [MVP] <
[email protected]> wrote:

Note that with PowerShell/PSScriptAnalyzer#1166
https://github.com/PowerShell/PSScriptAnalyzer/pull/1166 we expect
another speed boost (twice the speed) in PSSA and we plan to release it to
the wild soon (hopefully this month)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/PowerShell/vscode-powershell/issues/1497#issuecomment-472184560,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKOQXSslhXIxDmQ8wXS2yZ7GiV6kTf7Nks5vWBk7gaJpZM4WMcXn
.

You're welcome. This is partly due to the new PSScriptAnalyzer release of 1.18.0.
@TylerLeonhardt Shall we close this issue now? Although I have accepted your invite to the this and the PSES repo, I seem to still not have contributor rights.

@bergmeister Yeah, I think we have enough other issues tracking our desire to continue improving performance. Fair to say this one tracked the degradation fixed by 1.18.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rs38 picture rs38  Â·  4Comments

rkeithhill picture rkeithhill  Â·  3Comments

lukegriffith picture lukegriffith  Â·  3Comments

guidooliveira picture guidooliveira  Â·  3Comments

GQnzo picture GQnzo  Â·  3Comments