Skip to content

tp: parse appended trace data without copying it - #7276

Draft
LalitMaganti wants to merge 1 commit into
dev/lalitm/zerocopy-6-owned-messagesfrom
dev/lalitm/zerocopy-7-parse-no-copy
Draft

tp: parse appended trace data without copying it#7276
LalitMaganti wants to merge 1 commit into
dev/lalitm/zerocopy-6-owned-messagesfrom
dev/lalitm/zerocopy-7-parse-no-copy

Conversation

@LalitMaganti

@LalitMaganti LalitMaganti commented Aug 28, 2026

Copy link
Copy Markdown
Member

Trace bytes arrive zero-copy into the tokenizer, and then Rpc::Parse
copies them straight back out because TraceProcessor needs to own what
it is given. For APPEND_TRACE_DATA that is a 32 MB memcpy per chunk,
which undoes the whole chain, on the wasm and httpd paths as much as
anywhere else.

Hand the parser the tokenizer's message instead: TraceBlob holds it for
as long as the bytes are needed, and the ring buffer moves onto another
buffer rather than recycling one still being read. Dispatching a message
now means handing over its bytes, so OnRpcMessage() takes an owned
message rather than a pointer and a length.

out/linux_clang_release/perfetto_integrationtests
--gtest_filter='Remote:Stdiod:ServerUnix'

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Trace bytes arrive zero-copy into the tokenizer, and then Rpc::Parse
copies them straight back out because TraceProcessor needs to own what
it is given. For APPEND_TRACE_DATA that is a 32 MB memcpy per chunk,
which undoes the whole chain, on the wasm and httpd paths as much as
anywhere else.

Hand the parser the tokenizer's message instead: TraceBlob holds it for
as long as the bytes are needed, and the ring buffer moves onto another
buffer rather than recycling one still being read. Dispatching a message
now means handing over its bytes, so OnRpcMessage() takes an owned
message rather than a pointer and a length.

out/linux_clang_release/perfetto_integrationtests \
    --gtest_filter='*Remote*:*Stdiod*:*ServerUnix*'
@LalitMaganti
LalitMaganti force-pushed the dev/lalitm/zerocopy-7-parse-no-copy branch from 3d2587d to 97857f0 Compare August 28, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant