From 621ba4d5b4ff507eea56259045c153c7d7de87be Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 16 Mar 2026 22:34:41 -1000 Subject: [PATCH] Set loop_interval to 0 in ApplicationLoop benchmark to skip sleep --- tests/benchmarks/core/bench_application_loop.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/benchmarks/core/bench_application_loop.cpp b/tests/benchmarks/core/bench_application_loop.cpp index 5acbe8beaad..dde78ae7390 100644 --- a/tests/benchmarks/core/bench_application_loop.cpp +++ b/tests/benchmarks/core/bench_application_loop.cpp @@ -10,6 +10,9 @@ namespace esphome::benchmarks { // This measures the baseline overhead of the main loop: scheduler, // timing, before/after loop tasks, and yield_with_select_. static void ApplicationLoop_Empty(benchmark::State &state) { + // Set loop interval to 0 so yield_with_select_ returns immediately + // instead of sleeping. This benchmarks the loop overhead, not the sleep. + App.set_loop_interval(0); for (auto _ : state) { App.loop(); }