nRPC Performance#380
Closed
LZL0 wants to merge 2 commits into
Closed
Conversation
T2.3: the unary fold polls the handler future once inline via spawn_or_inline and only tokio::spawn's it when Pending — a synchronous handler emits its RESPONSE without the spawn + wake. Streaming/client-stream/duplex folds are unchanged (their handler tasks always park awaiting the pump JoinHandle). T2.1: all four server folds gain an inherent apply_shared(&self) (RedexFold trait untouched; trait impl delegates), in_flight / flow_control / chunk-sender maps move Mutex<HashMap> -> DashMap with atomic entry()-based duplicate-REQUEST refusal, and RpcClientFold::apply_inbound takes &self — bridge tasks and the reply-channel dispatcher drive folds with no Arc<Mutex<...>> wrapper. Measured (quick A/B, win11 host): c1/32B 34.31 -> 33.73 us (-1.6%, p=0.00); c16/32B unchanged — consistent with the scaling plan's finding that the throughput ceiling is the recv loop, not dispatch. The follow-up audit doc is corrected accordingly (c128 claims struck, ack-piggyback + batched recv promoted to primary throughput levers). Tests: 3 new unit tests pin inline emission, pending->spawn hand-off, and inline-path panic containment; cortex rpc units (78), nRPC integration (36), SDK mesh_rpc suites, and full lib (4310) all green.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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 by cubic
Inline-ready unary RPC dispatch and lock-free folds to trim c1 latency and simplify mesh bridges. Small c1 win; throughput focus updated to the shared recv loop.
DashMapand exposeapply_shared(&self)/apply_inbound(&self); bridge code drives folds withoutArc<Mutex<...>>. TheRedexFoldtrait remains and delegates.entry()checks; CANCEL and self-clean paths useDashMap::remove. Streaming folds also moveflow_controland request-chunksenderstoDashMap.Written for commit 1e4a0b7. Summary will update on new commits.