Skip to content

perf: zz/noZZ - #919

Open
ldintr wants to merge 1 commit into
ldintr-toPbjReaderfrom
ldintr-zz
Open

perf: zz/noZZ#919
ldintr wants to merge 1 commit into
ldintr-toPbjReaderfrom
ldintr-zz

Conversation

@ldintr

@ldintr ldintr commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Replaces calls with a compile-time-constant zigzag boolean (readVarInt(false), writeVarInt(value, true)) with dedicated *NoZZ/*ZZ methods across generated code and ProtoParserTools/ProtoWriterTools, removing a per-call branch from the hottest (de)serialization paths. No wire-format change.

Overview: PbjReader/PbjWriter are a leaner, buffer-reusing alternative to the existing ReadableSequentialData/WritableSequentialData read/write path used by Codec, ProtoParserTools/ProtoWriterTools, and the pbj-compiler generators. They reuse an internal ~16KB (L1-cache-sized) buffer across many parse/write calls instead of allocating per call, avoid checked-exception-based control flow by recording a sticky internal error code instead, and split hot-path operations (e.g. zigzag vs. non-zigzag varints, direct UTF-8 decode into a reusable char[]) into dedicated fast methods.

Signed-off-by: ldintr <levo.d@swirldslabs.com>
@ldintr
ldintr requested review from a team as code owners August 31, 2026 16:48
@ldintr ldintr self-assigned this Aug 31, 2026
@github-actions

Copy link
Copy Markdown

JUnit Test Report

   523 files  +  2     523 suites  +2   31s ⏱️ -1s
 1 642 tests +105   1 638 ✅ +105   4 💤 ±0  0 ❌ ±0 
10 860 runs  +105  10 832 ✅ +105  28 💤 ±0  0 ❌ ±0 

Results for commit 4bc3c7a. ± Comparison against base commit 6d7fc83.

@github-actions

Copy link
Copy Markdown

Integration Test Report

    428 files  ±0      428 suites  ±0   23m 18s ⏱️ + 5m 26s
115 048 tests ±0  115 048 ✅ ±0  0 💤 ±0  0 ❌ ±0 
115 292 runs  ±0  115 292 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 4bc3c7a. ± Comparison against base commit 6d7fc83.

@ldintr ldintr mentioned this pull request Sep 3, 2026
@ldintr
ldintr changed the base branch from main to ldintr-toPbjReader September 9, 2026 20:58
@ldintr
ldintr added this pull request to stack #908 September 9, 2026 21:01
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