Skip to content

[k2] rpc client: avoid copying and allocating request buffer - #1680

Open
T-y-c-o-o-n wants to merge 17 commits into
masterfrom
n.siniachenko/k2/rpc-request-avoid-copying-and-allocating-request-buffer
Open

[k2] rpc client: avoid copying and allocating request buffer#1680
T-y-c-o-o-n wants to merge 17 commits into
masterfrom
n.siniachenko/k2/rpc-request-avoid-copying-and-allocating-request-buffer

Conversation

@T-y-c-o-o-n

@T-y-c-o-o-n T-y-c-o-o-n commented Aug 24, 2026

Copy link
Copy Markdown
Contributor
  • changed f$rpc_clean() semantics: now it not only clears tl_storer and tl_fetcher, but also puts kphp::rpc::detail::RESERVED_HEADER_SIZE zero bytes in storer (tl_fetcher remains empty).
  • RPC client (kphp::rpc::send_request() function) uses these reserved bytes to store new regularized rpc header directly before request body.
  • RPC server (f$rpc_server_store_response() function) skips these bytes in copying response.
  • kphp::rpc::init_server(): added tl_storer clear before invoke_rpc.query storing.

@T-y-c-o-o-n T-y-c-o-o-n added optimization Memory comsumption / CPU speedup runtime Feature related to runtime k2 Affects compiler or runtime in K2 mode labels Aug 24, 2026
@T-y-c-o-o-n T-y-c-o-o-n added this to the next milestone Aug 24, 2026
@T-y-c-o-o-n T-y-c-o-o-n self-assigned this Aug 24, 2026
@T-y-c-o-o-n
T-y-c-o-o-n requested a review from apolyakov August 24, 2026 09:57
apolyakov
apolyakov previously approved these changes Aug 24, 2026
@T-y-c-o-o-n
T-y-c-o-o-n force-pushed the n.siniachenko/k2/rpc-request-avoid-copying-and-allocating-request-buffer branch from 9e18bfe to 8bddd11 Compare August 24, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

k2 Affects compiler or runtime in K2 mode optimization Memory comsumption / CPU speedup runtime Feature related to runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants