Skip to content

api(channels): stable const char*/enum driver identity instead of fl::string names (from #4799) #4821

Closed as not planned

Description

@zackees

Split out of #4799 (part of #4801).

#4820 removed the per-frame string work in the show paths (isDriverEnabled by instance). The flash part of #4799 needs driver identity to stop being fl::string:

  • IChannelDriver::getName() returns fl::string, with 32 overrides and about 140 call sites in src/;
  • ChannelManager stores fl::string names and compares them in getDriverByName/findDriverByName/setDriverEnabled/setDriverPriority/selectDriverForChannel.

Proposal

Give drivers a stable const char* (or small enum) identity alongside getName(), store it in EngineEntry, and move the manager lookups onto it. Then deprecate the fl::string overloads. This is a public interface change for out-of-tree drivers, so do it after the release with a deprecation window.

Acceptance

  • No fl::string in driver registration or lookup.
  • Measure whether basic_string code drops from ESP32 Blink/APA102 maps; it is also reachable from logging.

Activity

  1. added
    type: feature
    area: core
    on Oct 9, 2026
  2. zackees commented on Oct 10, 2026

    @zackees
    MemberAuthor

    Measured and dropped (maintainer decision). A prototype added virtual const char* IChannelDriver::getId() and converted the 22 in-tree literal-named drivers, with getName() defaulting to the ID. It made esp32dev/esp32s3 Blink and APA102 larger by 8–100 B versus master 96d42dfbe3: the extra vtable slot outweighs the removed overrides, and fl::string stays linked through logging and the runtime-named drivers (SPI adapter, d21/d51, nrf52, stm32, LPUART, bitbang). A manager-side ID fast path would only add comparison code. The per-frame cost #4799 was about is already gone (#4820), so there is no remaining reason for the interface change.

  3. moved this from Triage to Done in FastLED Trackeron Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coretype: feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions