Skip to content

Use varhandles to to improve perf in Protobuf Parser and Generator - #763

Merged
cowtowncoder merged 7 commits into
FasterXML:3.xfrom
pjfanning:protobuf-varhandle2
Sep 7, 2026
Merged

Use varhandles to to improve perf in Protobuf Parser and Generator#763
cowtowncoder merged 7 commits into
FasterXML:3.xfrom
pjfanning:protobuf-varhandle2

Conversation

@pjfanning

@pjfanning pjfanning commented Aug 22, 2026

Copy link
Copy Markdown
Member

I added a benchmark to https://github.com/pjfanning/jackson-bench

Parser (Java 17.0.19)

Benchmark                                                            Mode  Cnt    Score    Error  Units
ProtobufDoubleArrayBench.benchParseFromByteArray                    thrpt    5  530.238 ± 31.017  ops/s
ProtobufDoubleArrayBench.benchParseFromByteArrayPacked              thrpt    5  618.494 ± 39.344  ops/s
ProtobufDoubleArrayBench.benchParseFromByteArrayPackedSwar          thrpt    5  740.256 ± 21.603  ops/s
ProtobufDoubleArrayBench.benchParseFromByteArraySwar                thrpt    5  630.836 ± 16.628  ops/s

Generator (Java 17.0.19)

Benchmark                                                                Mode  Cnt     Score     Error  Units
ProtobufDoubleArrayGenBench.benchGenerateToByteArray                    thrpt    5  1089.258 ±  22.509  ops/s
ProtobufDoubleArrayGenBench.benchGenerateToByteArrayPacked              thrpt    5  1189.129 ±  20.055  ops/s
ProtobufDoubleArrayGenBench.benchGenerateToByteArrayPackedSwar          thrpt    5  1787.496 ± 198.869  ops/s
ProtobufDoubleArrayGenBench.benchGenerateToByteArraySwar                thrpt    5  1822.569 ±  32.360  ops/s

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown

🧪 Code Coverage Report

Coverage Type Coverage Change
📝 Instructions 76.66% 📉 -0.07%
🔀 Branches 68.26% 📉 -0.03%

@pjfanning
pjfanning marked this pull request as draft August 22, 2026 09:25
@pjfanning
pjfanning marked this pull request as ready for review August 22, 2026 09:27
@cowtowncoder cowtowncoder changed the title use varhandles to to improve perf in Protobuf Parser and Generator Use varhandles to to improve perf in Protobuf Parser and Generator Sep 4, 2026
@cowtowncoder cowtowncoder added protobuf 3.x performance Issue/PR related to performance; usually optimization there-of labels Sep 4, 2026
@cowtowncoder
cowtowncoder merged commit 5a17c39 into FasterXML:3.x Sep 7, 2026
3 checks passed
@pjfanning
pjfanning deleted the protobuf-varhandle2 branch September 7, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x performance Issue/PR related to performance; usually optimization there-of protobuf

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants