Skip to content

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

Closed

Description

@jahands

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

Activity

  1. TylerLeonhardt commented on Aug 25, 2018

    @TylerLeonhardt
    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?

  2. jahands commented on Aug 25, 2018

    @jahands
    Author

    Yes actually. Here's cloc output:
    image

  3. rjmholt commented on Aug 25, 2018

    @rjmholt
    Contributor

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

  4. jahands commented on Aug 29, 2018

    @jahands
    Author
  5. TylerLeonhardt commented on Aug 29, 2018

    @TylerLeonhardt
    Member

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

  6. jahands commented on Aug 29, 2018

    @jahands
    Author
  7. rjmholt commented on Aug 29, 2018

    @rjmholt
    Contributor

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

  8. rjmholt commented on Aug 29, 2018

    @rjmholt
    Contributor

    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
  9. jahands commented on Sep 4, 2018

    @jahands
    Author

    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.

  10. rjmholt commented on Oct 10, 2018

    @rjmholt
    Contributor

    Jacob Hands (@jahands) Have you noticed any performance improvement with the latest release?

  11. SeeminglyScience commented on Oct 10, 2018

    @SeeminglyScience
    Collaborator

    Rob Holt (@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.

  12. jahands commented on Oct 10, 2018

    @jahands
    Author

    Patrick Meinecke (@SeeminglyScience) I'm happy to see that PR.

    Rob Holt (@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.

  13. rjmholt commented on Oct 10, 2018

    @rjmholt
    Contributor

    Jacob Hands (@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. Patrick Meinecke (@SeeminglyScience) has merged a fix there, so we are now waiting on a release from them to get it downstream.

  14. gerane commented on Oct 30, 2018

    @gerane

    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 David Wilson (@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.

  15. bergmeister commented on Mar 12, 2019

    @bergmeister
    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)

  16. jahands commented on May 2, 2019

    @jahands
    Author
  17. bergmeister commented on May 2, 2019

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

  18. rjmholt commented on May 2, 2019

    @rjmholt
    Contributor

    Christoph Bergmeister (@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions