Skip to content

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

Open
pjfanning wants to merge 1 commit into
FasterXML:3.xfrom
pjfanning:protobuf-varhandle2
Open

use varhandles to to improve perf in Protobuf Parser and Generator#763
pjfanning wants to merge 1 commit 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

Copy link
Copy Markdown

🧪 Code Coverage Report

Coverage Type Coverage Change
📝 Instructions 76.26% 📉 -0.45%
🔀 Branches 68.25% 📉 -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
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