Skip to content

perf(channels): finish the static showPixels size reduction after #4563 #4566

Closed

Description

@zackees

Context

Merged PR #4563 bound the compile-time ESP-IDF5 WS2812 encoder at channel construction. On the same ESP32-S3 Blink build, Channel::showPixels fell from 4,164 B to 2,584 B and whole-firmware flash fell 7,768 B. Only the WS2812 encoder/writer remains among protocol writers, so unused writer retention is no longer the Blink problem.

The common Channel::showPixels still includes the runtime pre-bound/dynamic branch (src/fl/channels/channel.cpp.hpp) and the resolveDynamicDriver() symbol is 628 B. Closed #2981 requested a ~1,000 B showPixels symbol and a 60 Hz / 100 LED frame-time check; those criteria were not completed by #4563. The current image is therefore a concrete starting point for the remaining dispatch work.

Proposal

Separate the pre-bound legacy addLeds<>() path from manager-created dynamic channels so the static ESP32-S3 Blink call path need not carry generic driver resolution and related setup in its hot function. Prototype the smallest viable entry-point/specialization boundary and compare both the named symbol and whole firmware; preserve dynamic Channel::create(config) semantics and error handling.

Acceptance criteria

  • RED: a focused symbol-size check on current Blink records showPixels == 2,584 B and fails the ~1,000 B target; existing tests preserve static and runtime channel behavior before changes.
  • GREEN: same-toolchain Blink showPixels is below ~1,000 B, unused protocol writers remain absent, and whole-firmware flash decreases after accounting for any new helpers or thunks.
  • Generic Channel::create(config) selection, SPI channels, RGBW/RGBWW, channel events, disabled-driver behavior, and failed-driver handling retain byte/output parity in focused tests.
  • A 60 Hz, 100-LED WS2812 frame-time comparison shows no measurable regression on target hardware or a documented equivalent timing harness.

Decisions

  • P2: the PR delivered real savings, but the original per-symbol and timing targets remain open.
  • Focus on static versus dynamic channel entry points; repeating the writer-binding refactor would duplicate refactor(channels): bind RMT5 pixel encoder at construction #4563.
  • Keep dynamic API behavior available by default; do not depend on FASTLED_DISABLE_DYNAMIC_DRIVER for the general fix.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions