System.Text.Json missing streaming reader in runtime / adopt existing implementation? #100439
Unanswered
bjornharrtell
asked this question in
Ideas
Replies: 1 comment 9 replies
-
Being async at every read/write operation is not performant. Such utility should expose synchronous There's also space for improvement in your shape of implementation:
|
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've since some time implemented streaming readers based on
System.Text.Json
that has been in production use for use cases with very large JSON payloads retrieved via stream. Source lives at https://github.com/bjornharrtell/Utf8JsonStreamReader and published at nuget at https://www.nuget.org/packages/Utf8JsonStreamReader andbenchmarks has shown it's faster than corresponding NewtonsoftJson based logicUPDATE: recent experiments suggest sync variant of Newtonsoft streaming reader is actually faster.I recall being surprised something similar wasn't already in the runtime. Actually I find it strangely asymmetric that the official
Utf8JsonWriter
is a class that can write to stream butUtf8JsonReader
is a ref struct and can only work with in memory buffer.I wonder if there are interest in officially adopting my implementation?
Beta Was this translation helpful? Give feedback.
All reactions