From 16b319488b070bd669b3316d6943de3be23711f4 Mon Sep 17 00:00:00 2001 From: Matteo Merli Date: Thu, 30 Jul 2026 23:42:33 +0200 Subject: [PATCH] Serialize the whole Frame in SimpleBenchmark.lightProtoSerialize 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. --- .../io/streamnative/lightproto/benchmark/SimpleBenchmark.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/src/main/java/io/streamnative/lightproto/benchmark/SimpleBenchmark.java b/benchmark/src/main/java/io/streamnative/lightproto/benchmark/SimpleBenchmark.java index 0a37775..447a89f 100644 --- a/benchmark/src/main/java/io/streamnative/lightproto/benchmark/SimpleBenchmark.java +++ b/benchmark/src/main/java/io/streamnative/lightproto/benchmark/SimpleBenchmark.java @@ -97,10 +97,10 @@ public void lightProtoSerialize(Blackhole bh) { p.setZ(3); frame.setName("xyz"); - p.writeTo(buffer); + frame.writeTo(buffer); buffer.clear(); - bh.consume(p); + bh.consume(frame); } @Benchmark