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

Omnisharp needs faster intellisense #3421

Closed
SamHSmith opened this issue Nov 22, 2019 · 11 comments
Closed

Omnisharp needs faster intellisense #3421

SamHSmith opened this issue Nov 22, 2019 · 11 comments

Comments

@SamHSmith
Copy link

Feature Request

VSCode is supposed to be light weight and therefor faster than an ide. Why is it then that both visual studio and monodevelop trump VSCode in intellisense. As soon as project start to grow it becomes very apparent how slow intellisense is. Maybe someone could look into why this is the case?

@cartermp
Copy link

cartermp commented Apr 9, 2020

Hey @SamHSmith I definitely agree that performance could be made better. Do you have some specific actions you take where it's slower to respond than normal? Concrete performance problems can typically be resolved, whereas more general issues are not very actionable. There are likely a number of factors involved here, so narrowing things down into specific actions can make it easier to progress.

@filipw
Copy link
Contributor

filipw commented Apr 15, 2020

OmniSharp/omnisharp-roslyn#1761 was merged

@cartermp
Copy link

@filipw unfortunately work like that, while useful, is kind of a shot in the dark. Unless there's a repro we can inspect and profile, it's impossible to say if an improvement like that has addressed the issue @SamHSmith is seeing.

@SamHSmith
Copy link
Author

@cartermp Sorry for the slow response. I haven't used vscode or csharp in quite some time but I remember my main issue being an extreme delay between pressing ctrl + space and the app reacting.
Not an issue on small projects but as the dependency list grew and grew it became a real problem. Maybe some kind of O(n^2) situation.

@ChristopherHaws
Copy link

ChristopherHaws commented Sep 8, 2020

I am having this issue as well. In a new ASP.NET Core controller, when I type this. to get intellisense, the suggestions window pops up immediately but shows Loading for about 8 seconds before showing results. In Visual Studio this same action takes less than 1 second. Also, this happens everytime I ask for intellisense suggestions, so it doesn't seem to be getting cached. To give you an idea of the size of my project, here is the output from cloc which counts lines of code in a given directory:

-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C#                             651          38991           5232         154483
JSON                            14              0              0          21244
TypeScript                     337           3286            204          18108
XML                              7              5              0           6670
PO File                          1            803             59           2101
Razor                           32            195             12           1391
Sass                            21            131              6            668
MSBuild script                  11             40              6            239
JavaScript                       3             20              6            177
Markdown                         2             20              0             51
SVG                              3              0              0             47
HTML                             1              4              0             33
-------------------------------------------------------------------------------
SUM:                          1083          43495           5525         205212
-------------------------------------------------------------------------------

When I hit ctrl+space to show the suggestion window, OmniSharp.exe takes up about 30% of my CPU and averages about 1GB of RAM.

My PC specs are:

  • i9-9900K CPU @ 3.6GHz (8 cores, 16 threads)
  • 32GB RAM
  • 1TB Samsung 970 Pro NVMe M.2 SSD

With these specs, 8+ seconds seems pretty long for a medium sized project.

@rib
Copy link

rib commented Jan 14, 2021

I've now got into a routine of disabling this plugin when I actually need to focus on coding because the intellisense is just soooo frustratingly slow that I basically can't type at a normal speed - which feels like a fairly ridiculous thing to have to be doing.

I'd love to have the functionality but not at the expense of being able to type whenever the plugin is stuck thinking about something.

It seems like maybe one of the problems is that it isn't working fully asynchronously - being slow is one thing but also synchronously blocking the user from typing seems really bad.

I saw a mention somewhere about the whole text file being sent to omnisharp each keystroke and that could be a scalability concern but right now I'm working with a text file with fewer than 500 lines of code and at times I'm seeing lagging in the order of one second per key press.

@an-dr-eas-k
Copy link
Contributor

@rib you could try my manual build from HEAD with the merged PR #4310. Download here: https://drive.google.com/file/d/18hsqlEGhneRJ9w2SJQF87c5WwlrQ3IKu/view?usp=sharing

@rib
Copy link

rib commented Jan 14, 2021

cool, thanks, I think maybe there's also something up with the performance of vscode in general for me actually, so all the blame probably doesn't really lie with omnisharp-vscode, it's maybe just exagerated (I realise now I'm also see very slow performance at times with this addon disabled). It could just be something like memory usage somewhere that's pushing me off a huge performance cliff.

The machine I'm using has 16GB of RAM but with Unity, vscode and a browser open then it's potentially just not enough and then as soon as the machine starts heavily swapping into Windows' virtual memory on disk then I guess it's game over.

@rib
Copy link

rib commented Feb 2, 2021

Just to follow up with a recent discovery: after I upgraded my system to 32GB of RAM and was still finding vscode lag to be unusable I eventually found that I'm probably hitting this other vscode issue here: microsoft/vscode#107016 - (Chromium/Electron can sometimes incorrectly enter an accessibility mode which has some severe performance problems associated with it.)

I've found I've been able to workaround this issue by using --disable-renderer-accessibility and so the problem (at least for me) probably isn't an Omnisharp issue at all, it's just what I was assuming since it felt a lot like the lag was from intellisense.

@seikosantana
Copy link

I've found I've been able to workaround this issue by using --disable-renderer-accessibility

Is there any way to make this a default instead of having to type this in each time i have to start vscode?

@JoeRobich
Copy link
Member

There have been a lot of improvements since this issue was opened. Please open a new issue with logs if you are still having trouble.

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

No branches or pull requests

9 participants