Why does Roslyn run in-proc (in devenv.exe) and make the editor stutter by re-reading storage.ide when there's a syntax error - but not when there's no errors? #62309
Unanswered
daiplusplus
asked this question in
Q&A
Replies: 1 comment 3 replies
-
@Jehoel please file a performance tract using the instructions here: https://github.com/dotnet/roslyn/blob/main/docs/wiki/Recording-performance-traces-with-PerfView.md To answer your question, the storage system is a public API that many services use. Without the trace reported above, there is no way to determine which component may be at fault. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(I'm not filing a bug report just yet - I want to eliminate a mis-configuration at my end first - especially because I'm unable to find other people reporting the same behaviour)
Repo steps:
Common.Data..csproj
- targets onlynetstandard2.0
, with<LangVersion>8.0</LangVersion><Nullable>enable</Nullable>
Common..csproj
- targets onlynetstandard2.0
, with<LangVersion>8.0</LangVersion><Nullable>enable</Nullable>
, and a project-reference toCommon.Data.csproj
.AnotherLibrary.csproj
- multi-targets .NET Framework 4.8 and .NET Core 3.1OldWebProject.csproj
- an old-school ASP.NET WebForms project targeting .NET Framework 4.8 (even with.aspx
view files).Common.csproj
: a class with some properties and a constructor whatnot - so long as it's valid C# and compiles and VS is happy.//
comment somewhere in the class: there should be no delay or stuttering in the UI thread or in the keyboard-typing-experience while you use your keyboard like a Steinway.public interface IThisMakesVSVerySlow { ObjectPool }
.cs
editor - and disk IO activity rises significantly - even if you're editing something that shouldn't make the IDE read anything from disk, like editing comment text (and nothing that uses intellisense, or causes popups or the completion window to open).So I fired-up procmon and logged all activity when editing that comment in a syntactically valid C# file, and again when I have that
interface IThisMakesVSVerySlow
causing the build error, and I saw that:.cs
file is syntactically valid, then editor performance is good, and onlyServiceHub.RoslynCodeAnalysisService.exe
accesses theRoslyn\Cache\RemoteWorkspace\{id}\sqlite3\v2\storage.ide-shm
, andstorage.ide-wal
files, and they're almost allWriteFile
events.WriteFile
toRemoteWorkspace\{id}\sqlite3\v2\storage.ide-wal
(This is the Sqlite write-ahead-log, right?)WriteFile
toRemoteWorkspace\{id}\sqlite3\v2\storage.ide-shm
.cs
file is syntactically invalid, then editor performance is horrible, and there is significantly more disk IO activity: procmon reports that on almost every keystrokedevenv.exe
(notServiceHub.RoslynCodeAnalysisService.exe
) re-reads from theC:\Users\Me\AppData\Local\Microsoft\VisualStudio\Roslyn\Cache\Host\{id}\sqlite3\v2\storage.ide
file.Roslyn\Cache\Host
directory, not theRoslyn\Cache\RemoteWorkspace
directory, though the{id}
string value is the same in both cases.ReadFile
events - all for 4096-byte buffers (I assume this is just Sqlite reading 4KB-sized pages?), that's 47MB in total (mystorage.ide
file itself is 388MB, so it was reading through 12% of the file on every keypress - why?),While procmon does show thread stack-traces for each logged event, I don't have symbols for
devenv.exe
, but here's a stack as reported by Procmon from one of theReadFile
events fordevenv.exe
:I have both procmon logs saved.
Beta Was this translation helpful? Give feedback.
All reactions