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(rmt5): single-channel fast path in beginTransmission (no copy/sort/pending queue) (#5375) #5382
ChannelEngineRMTImpl::beginTransmission() (src/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cpp.hpp) runs the general multi-strip path for every frame:
copies every ChannelDataPtr (a shared_ptr, so one atomic refcount update per copy) into a vector_inlined;
sorts it with sort_small;
pushes each entry onto mPendingChannels;
runs processPendingChannels() to pop it again.
For the common single-strip frame that is about 1k instructions per show() of bookkeeping.
Fix
Add a fast path inside the engine for a frame with one channel and a free hardware channel: go straight to acquire and transmit, with no copy, sort or pending-queue round trip.
Multiple strips, or more strips than hardware channels, keep today's path unchanged.
Constraints
No change in behaviour when channels are full or strips outnumber hardware channels.
The existing RMT host tests must pass. Add one showing a single-channel frame transmits without going through the pending queue.
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
perf(rmt5): single-channel fast path in beginTransmission (FastLED#5382…