mirror of
https://github.com/esphome/esphome.git
synced 2026-09-13 00:07:32 +00:00
f40eb9b78067f591cc3dd54108157979714ea3b3
Replace heap-allocated ContinuationAction/WhileLoopContinuation/ RepeatLoopContinuation instances with inline members, eliminating one heap allocation per IfAction/WhileAction/RepeatAction at setup. Each parent already needs exactly one continuation as the chain terminator that hands control back. Heap-allocating it costs the ~16-byte object plus an ~8-byte heap header per instance, plus heap fragmentation. Inlining moves the same 16 bytes from heap to BSS and drops the heap header overhead. Per-parent net change: - BSS: +16 B (the inline continuation; +32 B for IfAction<true>) - Heap: -24 B per heap allocation eliminated (16 B object + ~8 B header) - Net RAM saved: ~8 B per simple parent, ~16 B for IfAction<true> - Plus: one fewer heap allocation per parent at setup, less fragmentation For IfAction<HasElse=false>, the else continuation is elided via [[no_unique_address]] + an empty wrapper struct, so it costs 0 B. Note: CI memory analysis only measures static RAM (BSS), not heap. This change moves bytes from heap to BSS, so the report will show BSS increasing while the actual heap savings (and fragmentation reduction) are not directly visible.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
592 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
