mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
d4d8e92243e3b213d2eefa96db815a461a2dfed1
The set_timeout lambda captured [this, curr_time_ns] (4 + 8 = 12 bytes), exceeding the std::function small buffer optimization threshold (8 bytes on 32-bit) and forcing a heap allocation every measurement cycle (every 3s in LP mode). Store curr_time_ns as a class member and capture only [this] (4 bytes), which fits inline in the SBO. Trades 8 bytes of permanent member storage to eliminate a heap alloc+free cycle per measurement.
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
545 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
