-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Consider using C#9 Source Generators for implementing SetParametersAsync #29550
Comments
Thanks for the flowers @ChristianWeyer. Just for the record: the perf improvement I measured was in a very narrow benchmark, which doesn't fully reflect the performance improvement in the context of the entire blazor framework. |
@ChristianWeyer thanks for contacting us. We looked at this as part of 5.0. It does improve perf a bit (@SteveSandersonMS has the data) but we didn't see any significant improvement and there were a few things we were concerned about, which is why we didn't do it.
/cc: @SteveSandersonMS am I missing something here? |
Thanks for contacting us. |
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. |
Thanks Javier for the details. Closing this as answered. |
@TanayParikh I believe Mackinnon wrote a prototype for this. We might want to re-open this topic, so leaving it open. |
I like the idea of optimizing parameter setting. No reason not to lean into the fact that C# is a statically typed language. In bUnit, we are able to stub/mock components during testing, due to the fact that parameters are assigned in a "duck typing" fashion at runtime. Essentially, we are able to replace one component with another (type), as long as it has the same parameters as the original, or a "capture all unmatched parameters" parameter. If I read the ideas in this issue correctly, that should still work, i.e. the basis is still that a component has a |
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. |
Thanks for contacting us. We're moving this issue to the |
The performance best practices here talk about a custom implementation of SetParametersAsync instead of using reflection:
https://docs.microsoft.com/en-us/aspnet/core/blazor/webassembly-performance-best-practices?view=aspnetcore-5.0#implement-setparametersasync-manually
@stefanloerwald has built a lib that uses C#9 source generators that shows significant perf improvements:
https://github.com/excubo-ag/Generators.Blazor
Could that be an approach to include into the Blazor framework?
The text was updated successfully, but these errors were encountered: