You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate switching to ArrayBufferWriter impl to simplify grow logic when reading from stream in JsonSerializer #32355
Yep, agreed. Since this is used internally, in this case, we can consider using PooledByteBufferWriter just like what we do on the Serialize/Write side.
That's essentially identical to PooledByteBufferWriter, if it also implemented the IBufferWriter<byte> interface (with slightly different growth logic). We should consider merging these and having only one copy.
Activity
davidfowl commentedon Feb 15, 2020
ArrayBufferWriter doesn't pool currently. That's likely a performance regression
ahsonkhan commentedon Feb 15, 2020
Yep, agreed. Since this is used internally, in this case, we can consider using
PooledByteBufferWriterjust like what we do on the Serialize/Write side.scalablecory commentedon Feb 15, 2020
Consider using the
ArrayBufferwe use in System.Net.ahsonkhan commentedon Feb 15, 2020
That's essentially identical to
PooledByteBufferWriter, if it also implemented theIBufferWriter<byte>interface (with slightly different growth logic). We should consider merging these and having only one copy.runtime/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs
Lines 13 to 16 in f06f46c
ahsonkhan commentedon Oct 19, 2021
The source still has the todo comment, likely worth addressing manually, or closing explicitly.