Repository navigation
Fixed large json deserialization regression - #8415
Closed
sunghwan2789 wants to merge 3 commits into
Closed
sunghwan2789 wants to merge 3 commits into
sunghwan2789 wants to merge 3 commits into
Conversation
sunghwan2789
marked this pull request as ready for review
July 3, 2025 05:48
Contributor
There was a problem hiding this comment.
Pull Request Overview
A memory-efficient fix for large JSON deserialization by replacing the pooled buffer approach with a streaming Pipe-based writer and reader.
- Replace
PooledArrayWriterwithPipeandUtf8JsonWriter(pipe.Writer)inResponseEnumerable - Add a new integration test (
TestLarge) and supportingLargeQueryResolvers - Record a large-response snapshot for the new test
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/StrawberryShake/Client/src/Transport.Http/ResponseEnumerable.cs | Swap out in-memory buffer for Pipe streaming and update parsing call |
| AnyScalarDefaultSerializationTest.cs | Add Execute_AnyScalarDefaultSerialization_TestLarge test and LargeQueryResolvers |
| AnyScalarDefaultSerializationTest.Execute_AnyScalarDefaultSerialization_TestLarge.snap | New snapshot capturing large JSON output |
Comments suppressed due to low confidence (1)
src/StrawberryShake/Client/src/Transport.Http/ResponseEnumerable.cs:91
- [nitpick] Switching to a Pipe-backed writer may introduce extra overhead for small payloads. Consider benchmarking or using a size threshold to fall back to the pooled buffer for smaller responses.
var pipe = new Pipe();
Contributor
Author
|
This is resolved in #8536 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8415 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While a rented array used to create a
JsonDocumentrequires its lifecycle to be tied to theJsonDocument's, this PR introduces a new method that is free from the issues observed before.Closes #8376