From 6d1a40f2105078885178a3c604cb95a50435b746 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 27 Feb 2026 21:27:41 -1000 Subject: [PATCH] Mark register_component_ as noinline to prevent setup() bloat Without the template wrapper, the compiler inlines the 24-byte function at each of ~92 call sites in setup(), growing setup() by ~284 bytes. Force a function call instead. Co-Authored-By: J. Nick Koston --- esphome/core/application.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/core/application.h b/esphome/core/application.h index ba3ce13291..ea70f8ac0d 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -521,7 +521,7 @@ class Application { #endif #endif - void register_component_(Component *comp); + __attribute__((noinline)) void register_component_(Component *comp); void calculate_looping_components_(); void add_looping_components_by_state_(bool match_loop_done);