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): keep fl::string off the IChannelDriver::poll() hot path (#5375) #5380
IChannelDriver::poll() returns DriverState by value, and it carries an fl::string error (src/fl/channels/driver.h). ChannelManager::poll() also keeps an fl::string firstError. They are built, copied and destroyed on every poll of every driver, several times per show() during the waits, even though the string is empty unless there's an error.
Fix
Take string construction off the poll path:
DriverState carries just the state enum (plus at most a static const char* or an error code).
Drivers expose the detailed error message through a separate accessor that is read only when the state is ERROR.
ChannelManager::poll() keeps no fl::string unless an error is actually seen.
Constraints
Keep the error message available to users: the reporting path still logs the driver's error text.
Update all drivers and mocks; the host tests for driver errors must keep passing.
Rules for this sub-issue (from the meta issue)
Keep the layered architecture. Fix this inside its layer. Don't bypass ChannelManager or the channel engine.
Accept on instructions, not wall time. Measure instructions per show() on the ESP32-C6 before and after. Use bash autoresearch esp32c6 --legacy --rmt with the counter from the measurement sub-issue. Put both numbers in the PR. Code layout alone moves wall time by 10–20 µs between builds, so a wall-time number on its own can't show a 5–10% cut.
Usual gates:
bash test --cpp;
bash lint;
a passing AutoResearch run with the show() latency gate on;
bash bloat esp32s3 --build, with no growth past the ratchet.
Keep it small. Don't grow the binary on small-memory tiers (AVR, ATtiny). If a new bulk kernel doesn't pay for itself on FL_PLATFORM_HAS_TINY_MEMORY builds, compile it out of them.
Activity
zackees commentedon Nov 22, 2026
Picking this up from the fastled2 plan in #5375; branch perf/5380-poll-no-string
perf(channels): keep fl::string off the IChannelDriver::poll() hot pa…