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

High CPU usage for CodeLens on overriden methods with many references #4335

Closed
leo-labs opened this issue Jan 7, 2021 · 1 comment · Fixed by #4418
Closed

High CPU usage for CodeLens on overriden methods with many references #4335

leo-labs opened this issue Jan 7, 2021 · 1 comment · Fixed by #4418

Comments

@leo-labs
Copy link
Contributor

leo-labs commented Jan 7, 2021

Issue Description

This is related to #4245.

I am working with a medium sized project that has a base class with many derived classes (ca. 500) and a few virtual methods that are overridden in many of the derived classes. CodeLens is still very slow when opening on of those files in vscode while using lots of CPU and renders vscode unusable.

I am not sure if this is a general problem that should be fixed for inherited / implemented class members or if we can just improved the logic for filtering out symbols for CodeLens.

The latter solution worked for me: I have added a "csharp.referencesCodeLens.filteredSymbols": [ ... ] option which entries are filtered additionally to the hardcodes ones in codeLensProvider.ts. If that is the way to go, I am happy to send a Pull request.

Steps to Reproduce

Expected Behavior

Actual Behavior

Logs

OmniSharp log

Post the output from Output-->OmniSharp log here

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.52.1
C# Extension: 1.23.8

Mono Information OmniSharp using built-in mono
Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.101 Commit: d05174dc5a

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/5.0.101/

Host (useful for support):
Version: 5.0.1
Commit: b02e13abab

.NET SDKs installed:
2.2.105 [/usr/local/share/dotnet/sdk]
2.2.402 [/usr/local/share/dotnet/sdk]
3.0.100 [/usr/local/share/dotnet/sdk]
3.1.102 [/usr/local/share/dotnet/sdk]
3.1.201 [/usr/local/share/dotnet/sdk]
5.0.101 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
addlocalnetreferences RafisTatar 0.4.8
auto-using Fudge 0.7.15
code-runner formulahendry 0.11.2
csharp ms-dotnettools 1.23.8
debugger-for-chrome msjsdiag 4.12.11
docomment k--kato 0.1.20
dotnet leo-labs 1.3.0
dotnet-interactive-vscode ms-dotnettools 1.0.160901
dotnet-test-explorer formulahendry 0.7.4
EditorConfig EditorConfig 0.16.4
gitlens eamodio 11.1.3
monkey-patch iocave 0.1.11
render-crlf medo64 1.5.16
vetur octref 0.31.3
vscode-apollo apollographql 1.18.0
vscode-dotnet-runtime ms-dotnettools 1.0.0
vscode-eslint dbaeumer 2.1.14
vscode-sql-formatter adpyke 1.4.4
@ssuraci
Copy link

ssuraci commented Jan 17, 2021

This may be related to #4072; have you tried to get a thread dump of the mono process that consumes 100% CPU (kill -QUIT <pid-of-mono-process> and see if it looks similar to mine ?

I've tried latest beta (1.23.9-beta with #4310 merged but unfortunately the bug is still here). I think the PR with configurable filters is very interesting, at least as a temporary workaround.

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

Successfully merging a pull request may close this issue.

2 participants