Skip to content
Discussion options

You must be logged in to vote

Source generated JSON serialization code is only invoked for response serialization in ASP.NET Core if the response size is less than half of the JsonSerializerOptions.DefaultBufferSize.

To clarify, the source generator is being used regardless of what the response size is. What changes really is whether fast-path or metadata-based source generator modes are being called.

I can't clear any clear recommendations here, but ultimately this a matter of trade-offs. How important is the added throughput of fast-path for your application, and is it pooling larger buffers to achieve it worth it?

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@ladeak
Comment options

@eiriktsarpalis
Comment options

@ladeak
Comment options

@eiriktsarpalis
Comment options

@ladeak
Comment options

Answer selected by ladeak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants