-
Notifications
You must be signed in to change notification settings - Fork 199
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
Use message pack instead of Json.NET #9214
Conversation
Out of interest does this move from JSON.net to MessagePack include the |
No, but that's because that code isn't merged yet. |
5b07c22
to
c988537
Compare
The message pack formatters were implemented incorrectly and did not work correctly in serialization scenarios, such as StreamJsonRpc. This change reworks them to fit within that framework.
This change updates TagHelperDeltaResult to return Checksums for tag helpers that were added and introduces a new OOP API for fetching tag heleprs by checksum. These are used to only fetch tag helpers from Roslyn OOP that aren't already cached by Razor tooling.
c988537
to
1b145d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 This benchmark was unhelpful because it just serialized/deserialized a very small type.
...azor/src/Microsoft.AspNetCore.Razor.LanguageServer/Serialization/JsonSerializerExtensions.cs
Show resolved
Hide resolved
...Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/Json/JsonDataConvert.cs
Outdated
Show resolved
Hide resolved
...zor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/DocumentSnapshotHandle.cs
Outdated
Show resolved
Hide resolved
...Razor.ProjectEngineHost/Serialization/MessagePack/Resolvers/ProjectSnapshotHandleResolver.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/TagHelperCache.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/OOPTagHelperResolver.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteTagHelperProviderService.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/TagHelperCache.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteTagHelperProviderService.cs
Outdated
Show resolved
Hide resolved
Very nice! Excited for this change to get in. |
Thank you so very much for your diligence and effort out there, @DustinCampbell & team! I cannot express enough how greatly appreciated this is to me. 🙏🙏🙏 |
Should #8371 be closed now, or is it tracking additional work? |
I think we should wait until the changes make their way to @Mike-E-angelo and see whether they're working. |
@DustinCampbell When will this be released? Can I track it somewhere? Thanks. |
@LockTar the PR will be set to the appropriate milestone when it merged into VS, with the version it merged into, so you can track it right here :) |
@davidwengier stupid of me! Of course the milestones. I was looking at |
I had the same question too @LockTar so thank you for finding that out for me 😅 |
@LockTar / @Mike-E-angelo: I just wanted to let you know that this change has flowed into Visual Studio. So, it should show up in the next VS Preview. |
Thank you for the update @DustinCampbell it is appreciated. If I understand correctly, that might be another 2 weeks or so (maybe more) before trying here to give the yay/nay. One thought I had is that I have provided an older version of my solution for another issue here: If you are able to confirm on your side with some testing on your side in regard to this issue, it would be further appreciated. 👍 |
Hi @DustinCampbell I have tried 17.8 P3 and unfortunately, while this issue may address other problems the problem persists for my solution. You should be able to reproduce it with the solution on your end with the link above. I appreciate any further consideration or efforts to address this. |
Hi @Mike-E-angelo, sorry for not getting back to you here sooner. We were able to reproduce the issue you described on the solution you provided a week or so ago, and I forgot to make note of it here. Sorry about that! The incorrect colors (affectionately known as "disco colors") aren't affected by this change. I was expecting this change to improve other memory and performance concerns you had raised. Very sorry for not reporting back here. |
Hi @DustinCampbell thank you for the update! It is appreciated. I wanted to clarify that the only relation the disco colors issue has is that it happens to host the solution for your review. I was being lazy and didn't want to re-upload it to another issue/location. 😁 I understand that this issue does not impact the reported issue there. For further clarity, I was hoping that this issue would assist #8371 but that does not appear to be the case. 😭 |
I was hoping for the same thing, and thanks very much for filing a new community issue with updated dumps and ETL traces. I'm digging into those now... |
This PR should improve the performance of communication with the Roslyn OOP and significantly reduce allocations. It does this by making the following changes:
FetchTagHelpersAsync
) has been added to request tag helpers from Roslyn OOP by checksum. The same caching mechanism is used in Roslyn OOP to ensure that this method doesn't have to re-compute tag helpers again.In addition, I've done work in this change to clean up code that is no longer needed. In particular, all of the JsonConverters (except for one in
Microsoft.VisualStudio.LiveShare.Razor
) have been deleted.@dotnet/razor-compiler: The only compiler-level change is an additional
HashCodeCombiner.Add(...)
overload that takes anImmutableArray<T>
.@davidwengier: This changes the project.razor.json format by replacing the old hash codes with checksums. So, this will require an insertion for VS Code.