EWSoftware / VSSpellChecker

A Visual Studio spell checker editor extension that checks the spelling of comments, strings, and plain text as you type. Supports configuration and various languages.
Other
377 stars 65 forks source link

vs 2019 - Slow opening of files #236

Closed OlympicLarry closed 2 years ago

OlympicLarry commented 3 years ago

VS Version: 16.11.2 (the same issue happens on earlier 16.x versions)

It takes around 7-8 seconds to open a .html file. The UI is non-responsive and produces a VS warning about the extension. Other file extensions (.cs) took 5-6 seconds to load.

I disabled the extension and the files open immediately.

Please let me know if there is something I can upload to help diagnose the issue.

EWSoftware commented 3 years ago

Can you provide an example that demonstrates the issue? Are you using the latest release of the spell checker?

OlympicLarry commented 3 years ago

Latest version is installed. When opening a solution that is connected to an azure's git repository, I see the problem. When opening a different solution that uses Azure devops (tfs), there isn't a problem.

If I open the source folder "open a local folder", not the solution, then the files open fast

More testing 1) opened the solution 2) manually opened a file with ctrl+o that is in the solution and it took 5-8 seconds 3) manually opened a file that is in a different project (not git) and it is fast, 0.5 seconds

More 1) Unloaded the web app project and then manually opened a file from the web app and it opened fast. 2) Reloaded the web project and manual file open (ctrl+o) is slow.

The is happening only with the web project.

More testing Tested with the old version of the solution that used azure devops (tfs) and it still has a similar issue, except only a 2 second load time. Only the web project is slow as well.

A similar project using azure tfs with no npm task runner loads fast. I only have 1 solution using the azure git repos.

EWSoftware commented 3 years ago

Unfortunately I have no way to test that particular setup. If the solution, project, and files are somehow remote, that would perhaps explain the slowness as to generate a configuration, the spell checker has to search the solution, project, and containing folders down to the file location for configuration files from which to merge the settings. On a local file system, those are fast operations. If the project system is somehow translating those to calls to a remote server, then it would likely slow things down.

A workaround for such projects would be to disable the "Spell check as you type" option and use the solution/project spell checking option to look for spelling issues.

OlympicLarry commented 3 years ago

I think there might be some confusion here. The files are all local. In one scenario I opened the solution file, and in the other, I opened the folder.

image

EWSoftware commented 3 years ago

Sorry, not familiar with Azure. Like I said, I've no way to test this setup. I have web projects both under and not under source control (TFS and GitHub) and files within them are fast to open. I don't know why this particular setup would be different.

OlympicLarry commented 3 years ago

Good news. Expanding on your suggestion to disable "Spell check as you type" option, I disabled all settings and removed all ignored words, ignored files, XML files, etc and the problem went away. Then by process of elimination re-enabled options and the culprit is in the Code Analysis Dictionaries" -> "Import project code analysis dictionaries if present".

I reset all settings and disabled that one and there is no delay opening files.

EWSoftware commented 3 years ago

Thanks for the update. I'm not sure why that would make such a difference.

EWSoftware commented 2 years ago

I think this may be related to #244 as when the code analysis dictionary option is enabled, it goes through the same code to search the project for those files. I've implemented several changes that should fix the GC issues so those changes may also fix this one. The changes will be in the next release due out in a few days.