mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
c530e52669a093df705e12df74aaddf3dbca6897
On ESP32 with CONFIG_LWIP_TCPIP_CORE_LOCKING, bypass lwip_setsockopt() for TCP_NODELAY by directly modifying tcp_pcb->flags under the TCPIP core lock. This eliminates ~1091 bytes of overhead per call (socket lookups, hook, switch cascade, refcounting) for what is just a single bit flip. The API frame helper toggles Nagle's algorithm on every message send via set_nodelay_for_message(), making this a hot path. The fast path reduces set_nodelay_raw_ from calling the full lwip_setsockopt to just acquiring the mutex, loading 3 pointers, and flipping the TF_NODELAY bit. Only enabled when both USE_LWIP_FAST_SELECT (cached lwip_sock pointer) and CONFIG_LWIP_TCPIP_CORE_LOCKING (real mutex protection) are available. Falls back to the standard setsockopt call otherwise.
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
546 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
