Skip to content

feat: Switched to PbjReader/PbjWriter - #913

Open
ldintr wants to merge 1 commit into
ldintr-dupeProtoWriterfrom
ldintr-switchPbj
Open

feat: Switched to PbjReader/PbjWriter#913
ldintr wants to merge 1 commit into
ldintr-dupeProtoWriterfrom
ldintr-switchPbj

Conversation

@ldintr

@ldintr ldintr commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

The actual cutover: Codec.parseImpl/writeImpl now take PbjReader/PbjWriter, with new parse/parseNoEx/write/writeNoEx entry points (old sequential-data methods kept temporarily as compatibility wrappers). Generators (CodecParseMethodGenerator, CodecWriteMethodGenerator, etc.) emit the new types and drop the old EOFException-catch idiom. JsonCodec/JsonTools/ProtoWriter updated similarly. Adds CodecParseMethodTest.

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:44
@ldintr ldintr self-assigned this Aug 31, 2026
@github-actions

Copy link
Copy Markdown

JUnit Test Report

   523 files  +1     523 suites  +1   31s ⏱️ +3s
 1 643 tests +4   1 639 ✅ +4   4 💤 ±0  0 ❌ ±0 
10 861 runs  +4  10 833 ✅ +4  28 💤 ±0  0 ❌ ±0 

Results for commit 2719638. ± Comparison against base commit 834ac47.

@github-actions

Copy link
Copy Markdown

Integration Test Report

    428 files  ±0      428 suites  ±0   21m 36s ⏱️ + 6m 11s
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 2719638. ± Comparison against base commit 834ac47.

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