Skip to content

perf(extension): reserve packed scalar buffers - #784

Open
fallintoplace wants to merge 3 commits into
anthropics:mainfrom
fallintoplace:perf/extension-packed-fixed-reserve-20261019
Open

fallintoplace wants to merge 3 commits into
anthropics:mainfrom
fallintoplace:perf/extension-packed-fixed-reserve-20261019

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Reduce allocations when encoding and decoding packed scalar extensions.

Why

Large packed fields can grow buffers repeatedly.

Implementation

  • Reserve space for large fixed32 and fixed64 values.
  • Preallocate buffers for packed scalar encoding.
  • Cover partial tails, mixed records, and negative varints.
  • Add opt-in Criterion benchmarks for decode and encode.

Benchmark

  • Fixed64 decode, 4,096 values: 2.89 us to 2.24 us (22% lower).
  • Fixed64 decode, 16,384 values: 20.16 us to 12.31 us (39% lower).
  • Apple M1 Pro, Rust 1.95, Criterion, 50 samples. The numbers are for decoding.

@github-actions

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@fallintoplace fallintoplace changed the title perf(extension): reserve space for packed fixed64 values perf(extension): reserve packed scalar buffers Oct 19, 2026

This branch has not been deployed

No deployments
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