From 93991317c4e9d2bae2519900a960ba37f710e8d4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 16 Mar 2026 22:08:22 -1000 Subject: [PATCH] Build benchmark library with -O2 to inline instrumentation hooks --- script/setup_codspeed_lib.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/setup_codspeed_lib.py b/script/setup_codspeed_lib.py index b89f5ef780..214714d698 100755 --- a/script/setup_codspeed_lib.py +++ b/script/setup_codspeed_lib.py @@ -134,6 +134,9 @@ def _write_library_json( f"-I{core_include}", f"-I{hooks_include}", # google benchmark build flags + # -O2 is critical: without it, instrument_hooks_start_benchmark_inline + # doesn't get inlined and shows up as overhead in profiles + "-O2", "-DNDEBUG", "-DHAVE_STD_REGEX", "-DHAVE_STEADY_CLOCK",