You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(channels): per-frame fl::string driver keys and name lookups in driver paths (2.8-6 KB) #4799
The driver paths build and copy fl::strings at runtime: about 2.8–6 KB of string, vector and log code per ESP32 sketch versus 3.10.3.
Per-frame key:SlimSpiBridgeController::resolveDriver() (src/fl/channels/slim_spi_bridge_controller.h:160) builds a fl::string busKeyevery frame and looks drivers up by name. showPixels() also calls isDriverEnabled(driver->getName().c_str()) per frame.
Name lookups:channel_manager_esp32.cpp.hpp does findDriverByName(fl::string::from_literal(...)).
Symbols linked:basic_string::write (856 B on S3), materialize (305), copy (185/155), vector_basic::grow_to, log_emit_prefix, itoa/utoa32.
Proposed fix
Identify drivers by a small integer or enum ID, or by const char* literal compared by pointer or strcmp, instead of fl::string. Cache the resolved driver in the controller and invalidate it on registry change.
Acceptance
No fl::string construction in the per-frame show path.
The string symbols above shrink in the Blink and APA102 maps.
Driver enable/disable and exclusive-driver tests pass.
Investigated during the #4801 pass (esp32dev/esp32s3); deferred to the structural work in #4800.
The call graph on current master (esp32dev Blink) shows the fl::string core (materialize, copy, the StringHolder variant) is reachable through every IChannelDriver::getName(), which returns fl::string (e.g. ChannelEngineRMT::getName → string::from_literal). It is also reachable through c_str() and string_n<32> users outside the driver path. Removing only the per-frame busKey in SlimSpiBridgeController::resolveDriver() saves CPU per frame but not measurable flash. The flash win needs driver identity to become an enum/ID (or const char*) across IChannelDriver, ChannelManager lookups and isDriverEnabled, which is an API change better done with #4800's channels slimming.
Per-frame string work in the show paths is fixed by #4820: ChannelManager::isDriverEnabled(const IChannelDriver&) matches by instance, used by SlimBridgeController, SlimSpiBridgeController and the Teensy 4 block controller. The remaining flash-oriented part, a driver identity API change, is split into #4821.
Activity
zackees commentedon Oct 9, 2026
Investigated during the #4801 pass (esp32dev/esp32s3); deferred to the structural work in #4800.
The call graph on current master (esp32dev Blink) shows the
fl::stringcore (materialize,copy, theStringHoldervariant) is reachable through everyIChannelDriver::getName(), which returnsfl::string(e.g.ChannelEngineRMT::getName→string::from_literal). It is also reachable throughc_str()andstring_n<32>users outside the driver path. Removing only the per-framebusKeyinSlimSpiBridgeController::resolveDriver()saves CPU per frame but not measurable flash. The flash win needs driver identity to become an enum/ID (orconst char*) acrossIChannelDriver,ChannelManagerlookups andisDriverEnabled, which is an API change better done with #4800's channels slimming.perf(channels): check driver enabled state by instance in show paths (#…
zackees commentedon Oct 9, 2026
Per-frame string work in the show paths is fixed by #4820:
ChannelManager::isDriverEnabled(const IChannelDriver&)matches by instance, used by SlimBridgeController, SlimSpiBridgeController and the Teensy 4 block controller. The remaining flash-oriented part, a driver identity API change, is split into #4821.