Skip to content

Conversation

sunghwan2789
Copy link
Collaborator

@sunghwan2789 sunghwan2789 commented Jul 3, 2025

While a rented array used to create a JsonDocument requires its lifecycle to be tied to the JsonDocument's, this PR introduces a new method that is free from the issues observed before.

Closes #8376

@sunghwan2789 sunghwan2789 marked this pull request as ready for review July 3, 2025 05:48
@sunghwan2789 sunghwan2789 requested a review from Copilot July 3, 2025 06:04
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PooledArrayWriter with Pipe and Utf8JsonWriter(pipe.Writer) in ResponseEnumerable
  • Add a new integration test (TestLarge) and supporting LargeQueryResolvers
  • 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();

@sunghwan2789
Copy link
Collaborator Author

This is resolved in #8536

@sunghwan2789 sunghwan2789 deleted the sb/fix/8376 branch August 28, 2025 02:54
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (e8ca8cc) to head (c89e48f).
⚠️ Report is 158 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #8415   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AnyType result regression (in 15.1.5)
1 participant