Skip to content

Shared code for source generators #79741

Answered by jkotas
bencyoung-Fignum asked this question in Ideas
Discussion options

You must be logged in to vote

For existing reflection APIs, there is opportunity to improve performance. .NET 7 had improvements in this space (https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/#reflection) and some more are planned for .NET 7.

The performance ceiling of the existing reflection APIs is given by the API shape - the reflection APIs take and return boxed values, perform a lot of validations and conversions, etc. Reflection is always going to be significantly slower than straight-line core. Source generators cannot really fix that.

System.Text.Json could then reuse the common generated API

What would the common generated API be? There is a lot of System.Text.Json specific details i…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@bencyoung-Fignum
Comment options

@bencyoung-Fignum
Comment options

Answer selected by bencyoung-Fignum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants