Open RononDex opened 4 years ago
@RononDex You could try setting the "csharp.maxProjectFileCountForDiagnosticAnalysis" setting to a low number ( 100 perhaps? ) and see if that helps performance.
Just tried it, it only reduces the time it takes to analyse the solution, but not the performance while it is analysing.
I think the issue is, that omnisharp gets pretty much all the system resources available on Linux, causing everything else to get slow (while on Windows Omnisharp won't get 100% of the resources)
Update:
Just working on moving my project to .netcoreapp3.1 (https://github.com/RononDex/Astrobot) and as soon as I put the target to netcoreapp3.1, vscode goes crazy. CPU load is almost all the time at 100% due to omnisharp spawning mono processes (why? its .net core only project) and everything gets incredibly slow (as in saving a file takes up to a minute).
This is with the mentioned project above (which is a very small project really)
Update2:
It seems the issue does not exist in omnisharp-vim VsCode is currently unusable for me on linux. Will be switching to native vim due to this
Update3:
Same issue on windows, so its not platform specific and other people seem to have the same issue in my company.
For me vscode is pretty much unusable at the moment because of this
Save operations can take anywhere from inbetween of 30s to 10minutes
Update4:
Seems the slow save is caused by
"editor.formatOnSave": true
if I turn that off it saves a lot faster (altough still pretty slow)
I'm having the same issue, something must've changed in the last month or so because it continuously shows the "Running save participants" dialog during save, even though I've always had formatOnSave
enabled.
I keep getting the same even with "formatOnSave" disabled
Editing any non C# file works fine, so it is defintly related to omnisharp
However, I have switched to neovim now, since vscode is just simply unusable
@RononDex Thanks for filing and sorry you're seeing issues. I tried cloning and building your repo, but it won't build. I also don't see high CPU load on my mac when opening up some files and formatting them. Do you have a buildable repro (e.g., clone -> build -> open specific file -> do something specific -> see high CPU load)? Thanks!
The repo certainly does build if you have the AwesomeChatBot Framework code locally
It looks for the source code locally if you build with Debug, but uses Nuget packages if you build with Release. So building with Release should certainly work.
However compiling never was an issue
are you sure this is not caused by another extension? there was a similar issue about "Running Save Participants" but it was determined that another extension caused it https://github.com/OmniSharp/omnisharp-vscode/issues/3561#issuecomment-584331672
Issue Description
On Linux I am getting a high cpu / resource usage from omnisharp when analysing large solutions (as in ~1.5 million lines of code, 65k files).
Simple tasks like saving a file will take forever. According to my task manager it is mainly mono using up that much of cpu time (the one supplied with the plugin).
After I changed a csproj file omnisharp crashe completly with this message in the log:
Full log:
Steps to Reproduce
Expected Behavior
Actual Behavior
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.42.1 C# Extension: 1.21.11
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.101 Commit: b377529961 Runtime Environment: OS Name: arch OS Version: OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/3.1.101/ Host (useful for support): Version: 3.1.1 Commit: a1388f194c .NET Core SDKs installed: 3.1.101 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.App 3.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |1987|annliu|0.3.1| |2077-theme|Endormi|1.4.3| |add-reference|adrianwilczynski|1.0.2| |auto-using|Fudge|0.7.9| |better-align|wwm|1.1.6| |Bookmarks|alefragnani|10.7.0| |calmness-vsc-theme|azamuddin|1.1.1| |city-lights-theme|yummygum|1.1.5| |cloudcode|googlecloudtools|1.1.2| |code-settings-sync|Shan|3.4.3| |code-spell-checker|streetsidesoftware|1.7.23| |codesnap|adpyke|1.0.27| |csharp|ms-vscode|1.21.11| |csharp-grammar-extended|dannymcgee|1.1.1| |csharp-model-to-builder|frasercrosbie|0.1.2| |csharpextensions|jchannon|1.3.1| |Cyberpunk|max-SS|1.2.5| |docomment|k--kato|0.1.8| |dotnet|formulahendry|0.0.4| |dotnet-core-essentials|KishoreIthadi|0.0.8| |dotnet-test-explorer|formulahendry|0.7.1| |EditorConfig|EditorConfig|0.14.4| |eva-theme|fisheva|0.7.9| |git-graph|mhutchie|1.21.0| |git-tree-compare|letmaik|1.8.0| |gitlens|eamodio|10.2.1| |graphql-for-vscode|kumar-harsh|1.15.3| |gruvbox|jdinhlife|1.4.0| |horizon-theme-vscode|jolaleye|2.0.2| |ilspy-vscode|icsharpcode|0.7.10| |jinja|wholroyd|0.0.8| |jira-plugin|gioboa|0.19.0| |latex-utilities|tecosaur|0.3.6| |latex-workshop|James-Yu|8.7.2| |material-icon-theme|PKief|3.9.3| |material-theme|zhuangtongfa|3.2.2| |mdx|silvenon|0.1.0| |midnight-city|dillonchanis|0.5.0| |msbuild-project-tools|tintoy|0.3.3| |mssql|ms-mssql|1.8.0| |namespace|adrianwilczynski|1.1.2| |noctis|liviuschera|10.26.0| |output-colorizer|IBM|0.1.2| |prettier-vscode|esbenp|3.20.0| |python|ms-python|2020.2.63072| |python-extension-pack|donjayamanne|1.6.0| |rainbow-brackets|2gua|0.0.6| |slime|smlombardi|3.2.1| |sqltools|mtxr|0.21.6| |supersharp|craigthomas|0.1.4| |synthwave-vscode|RobbOwen|0.1.1| |team|ms-vsts|1.161.0| |theme-onedark|azemoh|0.5.3| |theme-panda|tinkertrain|1.3.0| |todo-tree|Gruntfuggly|0.0.167| |vim|vscodevim|1.12.4| |vscode-csharp-snippets|jorgeserrano|0.3.1| |vscode-custom-css|be5invis|3.0.9| |vscode-django|batisteo|0.19.0| |vscode-docker|ms-azuretools|0.10.0| |vscode-kanban|mkloubert|1.26.2| |vscode-mdx-preview|xyc|0.2.2| |vscode-nxunit-test-adapter|wghats|0.1.3| |vscode-peacock|johnpapa|3.3.1| |vscode-test-explorer|hbenl|2.17.0| |vscode-theme-hydra|juanmnl|3.1.0| |vscode-typescript-tslint-plugin|ms-vscode|1.2.3| |vscode-versionlens|pflannery|0.24.0| |vscode-wakatime|WakaTime|2.3.0| |vscodeilviewer|josephwoodward|0.0.1| |vscodeintellicode|VisualStudioExptTeam|1.2.5| |vsliveshare|ms-vsliveshare|1.0.1615| |xml|DotJoshJohnson|2.5.0|;