Skip to content
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

Decreased performance in the last couple months in large modules #1497

Closed
jahands opened this issue Aug 25, 2018 · 18 comments
Closed

Decreased performance in the last couple months in large modules #1497

jahands opened this issue Aug 25, 2018 · 18 comments
Labels

Comments

@jahands
Copy link

jahands commented Aug 25, 2018

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
@TylerLeonhardt
Copy link
Member

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?

@jahands
Copy link
Author

jahands commented Aug 25, 2018

Yes actually. Here's cloc output:
image

@rjmholt
Copy link
Contributor

rjmholt commented Aug 25, 2018

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

@jahands
Copy link
Author

jahands commented Aug 29, 2018 via email

@TylerLeonhardt
Copy link
Member

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

@jahands
Copy link
Author

jahands commented Aug 29, 2018 via email

@rjmholt
Copy link
Contributor

rjmholt commented Aug 29, 2018

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

@rjmholt
Copy link
Contributor

rjmholt commented Aug 29, 2018

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

@jahands
Copy link
Author

jahands commented Sep 4, 2018

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.

@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2018

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

@SeeminglyScience
Copy link
Collaborator

@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.

@jahands
Copy link
Author

jahands commented Oct 10, 2018

@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.

@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2018

@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.

@gerane
Copy link

gerane commented Oct 30, 2018

@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.

@bergmeister
Copy link
Contributor

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

@jahands
Copy link
Author

jahands commented May 2, 2019 via email

@bergmeister
Copy link
Contributor

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.

@rjmholt
Copy link
Contributor

rjmholt commented May 2, 2019

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants