From 10e05b5efa75ea2d9c4cd3fbb1e127a0dc73c399 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 16 Mar 2026 22:13:11 -1000 Subject: [PATCH] Build all benchmark code with -O2 instead of -Os --- script/cpp_benchmark.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/cpp_benchmark.py b/script/cpp_benchmark.py index 7487815402..f30054fbad 100755 --- a/script/cpp_benchmark.py +++ b/script/cpp_benchmark.py @@ -27,9 +27,13 @@ CORE_BENCHMARKS_DIR: Path = Path(root_path) / "tests" / "benchmarks" / "core" BENCHMARK_CODEGEN_COMPONENTS = BASE_CODEGEN_COMPONENTS | {"json"} PLATFORMIO_OPTIONS = { + "build_unflags": [ + "-Os", # remove default size-opt + ], "build_flags": [ - USE_TIME_TIMEZONE_FLAG, + "-O2", # optimize for speed (CodSpeed recommends RelWithDebInfo) "-g", # debug symbols for profiling + USE_TIME_TIMEZONE_FLAG, ], # Use deep+ LDF mode to ensure PlatformIO detects the benchmark # library dependency from nested includes.