Skip to content

Serialize the whole Frame in SimpleBenchmark.lightProtoSerialize - #16

Merged
merlimat merged 1 commit into
streamnative:masterfrom
merlimat:fix-simple-serialize-bench
Jul 30, 2026
Merged

Serialize the whole Frame in SimpleBenchmark.lightProtoSerialize#16
merlimat merged 1 commit into
streamnative:masterfrom
merlimat:fix-simple-serialize-bench

Conversation

@merlimat

Copy link
Copy Markdown
Collaborator

The benchmark filled a Frame (name + nested Point) but then wrote only the Point child, so its score never covered string serialization or the message envelope — masking any regression on those paths. It now writes the whole Frame, matching what protobufSerialize measures.

New reference score: 164 ops/µs (5 forks, ±3.3, JDK 26 / Apple M-series) vs ~170 for the old Point-only measurement — post-#12 the array-compose write makes the extra string+envelope work nearly free at this message size. protobuf-java counterpart: 28.8 ops/µs.

The benchmark filled a Frame (name + nested Point) but then wrote only
the Point child, so the score never covered string serialization or the
message envelope. Write the Frame like the protobuf counterpart does.

New reference score: 164 ops/us (5 forks), vs ~170 for the old
Point-only measurement - the array-compose write path makes the extra
string+envelope work nearly free at this message size.
Copilot AI review requested due to automatic review settings July 30, 2026 21:58
@merlimat
merlimat merged commit f3d20f5 into streamnative:master Jul 30, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes SimpleBenchmark.lightProtoSerialize so it benchmarks serializing the full Frame (including the string name and the message envelope), aligning it with what protobufSerialize measures and avoiding under-reporting regressions on those paths.

Changes:

  • Serialize the full Frame instead of only the nested Point.
  • Update the JMH blackhole consumption to consume frame (not p) to match the benchmarked object.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants