Please do... and if I understood correctly that we're already dropping pool arrays as part of JsonDocument on success paths, please open an issue about that as well. Thanks.
Originally posted by @stephentoub in #73338 (comment)
Relevant code:
|
// For performance, share the same buffer across serialization and deserialization. |
|
// The PooledByteBufferWriter is cleared and returned when JsonDocument.Dispose() is called. |
|
PooledByteBufferWriter output = new(options.DefaultBufferSize); |
|
using Utf8JsonWriter writer = new(output, options.GetWriterOptions()); |
|
|
|
WriteCore(writer, value, jsonTypeInfo); |
|
return JsonDocument.ParseRented(output, options.GetDocumentOptions()); |
Likely introduced by #57327, so this is not a .NET 7 regression.
Please do... and if I understood correctly that we're already dropping pool arrays as part of JsonDocument on success paths, please open an issue about that as well. Thanks.
Originally posted by @stephentoub in #73338 (comment)
Relevant code:
runtime/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Document.cs
Lines 117 to 123 in 4f835ae
Likely introduced by #57327, so this is not a .NET 7 regression.