-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Ability to use System.Text.Json's generated sources to improve PersistentComponentState's json read performance #40683
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
I understand that you have a lot of work, but given its simplicity, it can greatly affect the startup time. Do we have an update on this? Will it reach dotnet 8? |
Thanks for contacting us. We're moving this issue to the |
Related #31877 |
While it's possible to defer this issue to even .NET 17 planning(!), this approach is not appropriate. The significant performance boost provided by System.Text.Json Source Generators is evident based on Microsoft's own data, and it's more beneficial in Blazor WebAssembly, which lacks JIT compilation. Currently, developers can customize their JSON options in ASP.NET Core MVC Restful API and ASP.NET Core Minimal API projects but not in Blazor applications! This omission negatively impacts performance, particularly in the Blazor WebAssembly Startup phase of pre rendered websites and JSRuntime Interop because it also involves System Text Json // MVC - Web API
builder.Services.AddControllers()
.AddJsonOptions(options => ... );
// Minimal API
builder.Services.Configure<JsonOptions>(options =>
{
...
}); |
I found my data need persist have a object cycle issue, try to fix it with another |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
No response
Describe the solution you'd like
PersistentComponentState's TryTakeFromJson method uses System.Text.Json's auto generated sources of JsonSerializerContext & JsonSerializable
I'd like to use something like what asp.net core web API has as followings:
So aspnet core web API uses MyAppJsonContext globally to improve its performance.
I'd like to use generated sources of System.Text.Json in client side to read transferred json state
Currently blazor uses JsonSerializerOptionsProvider which is internal and we can't call .AddContext() to make sure it has access to our source generator based context
Additional context
No response
The text was updated successfully, but these errors were encountered: