mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 12:35:25 +00:00
light-inline-color-mode-to-bit
Although to_bit is constexpr and header-defined, the compiler leaves it as an out-of-line function when called with a runtime ColorMode, costing a call0/call8 for what is a short linear search over a 10-entry compile-time table. Marking it ESPHOME_ALWAYS_INLINE lets the compiler fold the lookup into each caller (validate_, color_mode_to_human, get_suitable_color_modes_mask_, light_json_schema). The to_bit symbol disappears from the link output entirely. Flash delta is small (+16 B ESP8266, +44 B ESP32-IDF in isolated light build); the intent is the runtime win — CodSpeed will quantify it.
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
393 MiB
Languages
C++
60.7%
Python
38.9%
C
0.3%
