Commit ee0e4c4
perf: optimize JSON deserialization from stream
Replaced `StreamReader.ReadToEnd()` and string-based deserialization with
direct stream deserialization in `SystemTextJsonSerializer.Deserialize<T>(Stream)`.
This change avoids an intermediate string allocation for the entire JSON payload,
reducing memory pressure and improving performance, especially for larger responses.
The stream disposal logic is maintained using the `using (stream)` pattern.
Co-authored-by: antarr <974295+antarr@users.noreply.github.com>1 parent 84cd802 commit ee0e4c4
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
130 | | - | |
| 129 | + | |
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
| |||
0 commit comments