You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce allocations in CSharpVirtualCharService.TryConvertStringToVirtualChars (#79623)
This method is accounting for 1.4% of allocations in the OOP process in a completion scenario in the RazorEditing.CompletionInCohosting speedometer test I am looking at.
Instead of doing all the work and hitting the pools, we can just handle the normal case of there not being any surrogates or escape characters and just create a VirtualCharSequence wrapper around the existing string.
Locally, I see about 75% of strings that come through hit this optimization.
Going to do a test insertion with this change to verify speedometer numbers before elevating out of draft status.
Copy file name to clipboardExpand all lines: src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/EmbeddedLanguages/VirtualChars/CSharpVirtualCharService.cs
0 commit comments