mirror of
https://github.com/esphome/esphome.git
synced 2026-05-25 02:16:13 +08:00
[benchmark] Use -Os to match firmware optimization level
CodSpeed benchmarks were building with -O2, while all firmware targets (ESP8266, ESP32, LibreTiny) use -Os. This mismatch means the benchmarks cannot detect inlining regressions that affect real devices — GCC under -O2 inlines functions that -Os outlines due to its size-conscious cost model. Remove the -Os unflag and -O2 override so benchmarks use the platform default -Os, matching what actually runs on devices.
This commit is contained in:
@@ -26,11 +26,7 @@ CORE_BENCHMARKS_DIR: Path = Path(root_path) / "tests" / "benchmarks" / "core"
|
||||
STUBS_DIR: Path = Path(root_path) / "tests" / "benchmarks" / "stubs"
|
||||
|
||||
PLATFORMIO_OPTIONS = {
|
||||
"build_unflags": [
|
||||
"-Os", # remove default size-opt
|
||||
],
|
||||
"build_flags": [
|
||||
"-O2", # optimize for speed (CodSpeed recommends RelWithDebInfo)
|
||||
"-g", # debug symbols for profiling
|
||||
"-DUSE_BENCHMARK", # disable WarnIfComponentBlockingGuard in finish()
|
||||
f"-I{STUBS_DIR}", # stub headers for ESP32-only components
|
||||
|
||||
Reference in New Issue
Block a user