Repository navigation
perf(client): reduce suspended OneWay state allocations - #796
Merged
Merged
Conversation
This was referenced Oct 9, 2026
SunSi12138
marked this pull request as ready for review
October 9, 2026 15:56
This was referenced Oct 9, 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.
Summary
Related to #729.
Split the existing internal OneWay async core into plain and streaming state machines after one descriptor check. Public/generated APIs and wrapper/lifecycle ownership stay unchanged.
This production PR contains only two files: the runtime change (+29 net lines) and two descriptor-shape regression cases. Tests verify producer ownership, wire flags, owned cancellation and pending/admission cleanup. Research infrastructure and experimental static-entry API B remain in unmerged Draft #795.
Allocation benefit
Hosted investigation 37945758812, using frozen A/C/B source 6ece2f7a and baseline
553854f5:Code-size tradeoff
Full-RPC 64-bit scalar/no-stream state shrinks 248→192 inline bytes; one/two-stream states 256/272→248/264 bytes. These are struct sizes, not heap-allocation measurements; the local fixture uses a different 32-bit request.
Aggregate MoveNext IL grows 1,781→2,078 B (+16.7%). In this six-shape fixture, NativeAOT executable size grows 25,072 B (+0.243%), and strict core native code grows 21,551→27,688 B (+28.5%). Individual executed bodies shrink but generic instantiations emit both branches; other contract catalogs can differ.
Validation and evidence
48c10e5d5244a715251be0bba1ae23ee7de435be96753e191f99adc0e28ecc89. Artifact-only recovery verified that digest and retained original raw rows/disassembly without rerunning measurements: 37950819696, 37951510883.Original investigation-head CI passed. Independent final review verified that two-file head
a90c83db0c1c549e9e1352b1f8cdcc2f42df35b7preserves the reviewed runtime/test blobs. This PR is Ready for review as requested by the owner; final-head CI continues in the background and is not represented as complete. Large Actions artifacts retain seven days; raw research evidence stays separate in #795, never in this production diff.