From 8e4091baa3f3c6d720233ef1c6f50dbc81591715 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 16 Mar 2026 23:40:18 -1000 Subject: [PATCH] Increase inner iterations from 1000 to 2000 to reduce jitter --- tests/benchmarks/components/api/bench_proto_decode.cpp | 2 +- tests/benchmarks/components/api/bench_proto_encode.cpp | 2 +- tests/benchmarks/components/api/bench_proto_varint.cpp | 2 +- tests/benchmarks/core/bench_helpers.cpp | 2 +- tests/benchmarks/core/bench_scheduler.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/benchmarks/components/api/bench_proto_decode.cpp b/tests/benchmarks/components/api/bench_proto_decode.cpp index 2208a61692..a5ecf78cde 100644 --- a/tests/benchmarks/components/api/bench_proto_decode.cpp +++ b/tests/benchmarks/components/api/bench_proto_decode.cpp @@ -8,7 +8,7 @@ namespace esphome::api::benchmarks { // Inner iteration count to amortize CodSpeed instrumentation overhead. // Without this, the ~60ns per-iteration valgrind start/stop cost dominates // sub-microsecond benchmarks. -static constexpr int kInnerIterations = 1000; +static constexpr int kInnerIterations = 2000; // --- HelloRequest decode (string + varint fields) --- diff --git a/tests/benchmarks/components/api/bench_proto_encode.cpp b/tests/benchmarks/components/api/bench_proto_encode.cpp index d58a2b01d2..c5dbd685be 100644 --- a/tests/benchmarks/components/api/bench_proto_encode.cpp +++ b/tests/benchmarks/components/api/bench_proto_encode.cpp @@ -8,7 +8,7 @@ namespace esphome::api::benchmarks { // Inner iteration count to amortize CodSpeed instrumentation overhead. // Without this, the ~60ns per-iteration valgrind start/stop cost dominates // sub-microsecond benchmarks. -static constexpr int kInnerIterations = 1000; +static constexpr int kInnerIterations = 2000; // --- SensorStateResponse (highest frequency message) --- diff --git a/tests/benchmarks/components/api/bench_proto_varint.cpp b/tests/benchmarks/components/api/bench_proto_varint.cpp index 440769ea67..ff4a656980 100644 --- a/tests/benchmarks/components/api/bench_proto_varint.cpp +++ b/tests/benchmarks/components/api/bench_proto_varint.cpp @@ -8,7 +8,7 @@ namespace esphome::api::benchmarks { // Inner iteration count to amortize CodSpeed instrumentation overhead. // Without this, the ~60ns per-iteration valgrind start/stop cost dominates // sub-microsecond benchmarks. -static constexpr int kInnerIterations = 1000; +static constexpr int kInnerIterations = 2000; // --- ProtoVarInt::parse() benchmarks --- diff --git a/tests/benchmarks/core/bench_helpers.cpp b/tests/benchmarks/core/bench_helpers.cpp index 5610d833e3..c6e1e6930e 100644 --- a/tests/benchmarks/core/bench_helpers.cpp +++ b/tests/benchmarks/core/bench_helpers.cpp @@ -7,7 +7,7 @@ namespace esphome::benchmarks { // Inner iteration count to amortize CodSpeed instrumentation overhead. // Without this, the ~60ns per-iteration valgrind start/stop cost dominates // sub-microsecond benchmarks. -static constexpr int kInnerIterations = 1000; +static constexpr int kInnerIterations = 2000; // --- random_float() --- // Ported from ol.yaml:148 "Random Float Benchmark" diff --git a/tests/benchmarks/core/bench_scheduler.cpp b/tests/benchmarks/core/bench_scheduler.cpp index 8382a4b228..d9d1575ebd 100644 --- a/tests/benchmarks/core/bench_scheduler.cpp +++ b/tests/benchmarks/core/bench_scheduler.cpp @@ -8,7 +8,7 @@ namespace esphome::benchmarks { // Inner iteration count to amortize CodSpeed instrumentation overhead. // Without this, the ~60ns per-iteration valgrind start/stop cost dominates // sub-microsecond benchmarks. -static constexpr int kInnerIterations = 1000; +static constexpr int kInnerIterations = 2000; // --- Scheduler fast path: no work to do ---