Repository navigation
[Fusion] Parse batched source results with purpose-built JSON tokenizer - #10644
Merged
Merged
Conversation
Contributor
Patch coverage94.3% of changed lines covered (132/140)
Uncovered changed lines (JSON){
"sha": "bd12a1f944d89905597162c67e84ee5938c11321",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultDocument.Tokenizer.cs", "ranges": [[514, 515], [523, 524], [1154, 1155], [1158, 1159]] }
]
}Project coverage: 59.1% (312918/529175 lines) |
tobias-tengler
force-pushed
the
tte/fusion-batched-source-tokenizer
branch
from
October 20, 2026 13:13
af1b632 to
b84bcd4
Compare
tobias-tengler
marked this pull request as ready for review
October 20, 2026 14:18
tobias-tengler
force-pushed
the
tte/fusion-batched-source-tokenizer
branch
from
October 20, 2026 14:50
c1a376d to
8349639
Compare
The batched array path gets a test per behavior: the rows of each element, empty arrays, input after the array, the depth limit, and the arrays it rejects, each parsed at every chunk boundary position in each chunk layout. The JSON result enumerable is tested end to end.
Batched array responses were the last source documents parsed with Utf8JsonReader over a ReadOnlySequence of the filled chunks. The tokenizer now reads the outer array and parses each element into its own document over the shared chunks, which removes the reader-based parser. Single document parses compile to the same code as before.
tobias-tengler
force-pushed
the
tte/fusion-batched-source-tokenizer
branch
from
October 20, 2026 15:32
8349639 to
a927135
Compare
This was referenced Oct 25, 2026
Merged
This was referenced Oct 28, 2026
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.
Batched array responses (variable batching) are the last source documents still parsed with
Utf8JsonReader. Each element is parsed through a reader over aReadOnlySequenceof the filled chunks, which is slower than the tokenizer and allocates sequence segments when the chunks are not adjacent.This PR reads the outer array in the source JSON tokenizer and parses each element into its own document over the shared chunks, through a second generic mode, so single document parses compile to the same code as before. The batched path accepts and rejects the same input as before and creates the same rows, which the tests added in the first commit pin down for every chunk boundary position of each chunk layout. The reader-based parser is removed.
Benchmarks against
7e8896336877