From 37d196643c07251960c9d0d5389e8a143ae55172 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 18 Feb 2026 22:33:08 -0600 Subject: [PATCH] [core] Devirtualize call_loop() and mark_failed() in Component Neither method is overridden anywhere in the codebase. Removing virtual eliminates one vtable slot per method from every Component-derived class (~100+ vtables), saving ~800+ bytes of flash globally. --- esphome/core/component.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/core/component.h b/esphome/core/component.h index 848bc0ba35..3f9116c75c 100644 --- a/esphome/core/component.h +++ b/esphome/core/component.h @@ -165,7 +165,7 @@ class Component { * For example, i2c based components can check if the remote device is responding and otherwise * mark the component as failed. Eventually this will also enable smart status LEDs. */ - virtual void mark_failed(); + void mark_failed(); // Remove before 2026.6.0 ESPDEPRECATED("Use mark_failed(LOG_STR(\"static string literal\")) instead. Do NOT use .c_str() from temporary " @@ -286,7 +286,7 @@ class Component { protected: friend class Application; - virtual void call_loop(); + void call_loop(); virtual void call_setup(); virtual void call_dump_config();