mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
807e786fac20c033467dc2456b114c79ae571a2c
Replace the virtual Socket base class with compile-time type aliases. Since only one socket implementation is active per build (selected via #ifdef), virtual dispatch was unnecessary overhead. Each implementation (BSDSocketImpl, LwIPSocketImpl, LWIPRawImpl) is now a concrete class in its own header with no virtual methods. socket::Socket and socket::ListenSocket are type aliases to the active implementation. For LWIP_TCP (ESP8266/RP2040), the listen socket is a separate type (LWIPRawListenImpl) sharing a non-virtual LWIPRawCommon base with the connected socket type (LWIPRawImpl). On BSD/LWIP_SOCKETS, both aliases resolve to the same type. This eliminates all vtable overhead, virtual destructors, and indirect call overhead across all platforms. Co-Authored-By: J. Nick Koston <nick@koston.org>
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%
