Skip to content

[Tracking] ESP32-S3 timing regression + binary bloat from Channel API (from #2420) #2421

Closed

Description

@zackees

Summary

Tracking issue for the timing-precision and binary-size regression on ESP32-S3 (and likely all ESP32 family + similar Channel-API platforms) reported in #2420 by @nomakewan.

This issue exists to coordinate investigation, organize fix proposals, and track shipping of the near-term mitigation.

Reported symptoms (from #2420)

  • Timing drift: A loop that should take 2500 ms now averages ~2600 ms with random spikes >3000 ms on master vs 3.10.3. Sketch is minimal: FastLED.show() every 5 ms via millisDelay, 35 WS2812B LEDs, NEOPIXEL pin only, setMaxRefreshRate(0), setCpuFrequencyMhz(160).
  • Binary bloat: Same sketch grew from 344 KB → 783 KB (+439 KB / 2.27x) between 3.10.3 and master#ea5d8ec.
  • Bare delay() is not swapped to fl::delay on Arduino targets (gated to FASTLED_STUB_IMPL at src/FastLED.h:1648), so async pumping in fl::delay is not the cause.

Root cause analysis (initial)

Timing jitter — vTaskDelay(1) floor in every show()

The new Channel API inserts two FreeRTOS-blocking waits per FastLED.show() call that did not exist in 3.10.3:

  1. Begin-frame wait: CFastLED::show() -> onBeginFrame() (FastLED.cpp.hpp:233) fires EngineEvents::onBeginFrame -> ChannelManager::onBeginFrame() -> waitForReady() (manager.cpp.hpp:401-403).
  2. End-frame wait: onEndFrame() (FastLED.cpp.hpp:280) -> ChannelManager::onEndFrame() -> driver->show() then waitForReadyOrDraining() (manager.cpp.hpp:405-415).

Both go through ChannelManager::waitForCondition (manager.cpp.hpp:326-336), which busy-loops:

while (!condition()) {
    if (timeoutMs && (millis() - startTime >= timeoutMs)) return false;
    task::run(250, task::ExecFlags::SYSTEM);   // <- blocks >=1 FreeRTOS tick
}

task::run(250, SYSTEM) -> pumpCoroutines(1000) (executor.cpp.hpp:135-141) -> on ESP32 (coroutine_esp32.impl.hpp:62-87) -> vTaskDelay(1 tick) minimum.

Math matches the report:

  • 35 WS2812B LEDs ~= 1.1 ms actual RMT transmission
  • Each show() adds ≥1× vTaskDelay(1) ≈ 1 ms (Arduino ESP32 default tick=1000Hz; would be 10 ms on stock IDF tick=100Hz)
  • 500 shows in 2500 ms × ~1 ms added blocking ≈ +500 ms drift — matches "up to 500 ms additional delay"
  • Random jitter: vTaskDelay aligns to tick boundary AND yields to whatever lower-priority task FreeRTOS picks (idle, lwIP, esp_timer)

setMaxRefreshRate(0) correctly zeros mNMinMicros and skips the spin-wait at FastLED.cpp.hpp:234, but the new waits are inside EngineEvents callbacks, not the rate limiter.

In 3.10.3 the RMT4 path used a semaphore wait inside endShowLeds() only — no per-show pre-wait, no engine-event indirection, no vTaskDelay(1) floor.

Binary bloat — unconditional driver compilation + registration

src/platforms/esp/32/drivers/_build.cpp.hpp unconditionally compiles every ESP32 driver family regardless of what the sketch uses:

  • ble, gpio_isr_rx, i2s, i2s_spi, lcd_cam, lcd_spi, parlio, rmt, rmt_rx, spi, uart
  • Plus channel_manager_esp32, cled, spi_hw_manager_esp32

Each driver self-registers as a shared_ptr<IChannelDriver> in ChannelManager::mDrivers, so the linker cannot dead-strip them. Largest contributors by source size:

  • parlio/parlio_engine.cpp.hpp ~2066 lines
  • rmt/rmt_5/channel_driver_rmt.cpp.hpp ~1520 lines
  • i2s/channel_driver_i2s.cpp.hpp ~619 lines
  • lcd_spi/channel_driver_lcd_spi.cpp.hpp ~459 lines
  • ble, uart, gpio_isr_rx, etc.

In addition, FastLED.h unconditionally pulls in the Task/Executor/Promise/Coroutine system (#include "fl/task/executor.h" at line 142) and the full Channel manager + events + audio + rx machinery (lines 161-168) — even for a NEOPIXEL-only sketch.

Proposed near-term mitigation

Add a build-time define such as FASTLED_TIGHT_TIMING (name TBD — alternatives: FASTLED_NO_ASYNC_WAIT, FASTLED_FAST_SHOW) that:

  1. Skips the begin-frame waitForReady() (driver should already be READY by next frame; if not, the encode-time safety check in Channel::showPixels() at channel.cpp.hpp:300 still protects us).
  2. Inside ChannelManager::waitForCondition, replaces task::run(250, SYSTEM) with a tight poll-then-yield: poll N times before falling back to vTaskDelay(1). For 35-LED WS2812B, ~1 ms transmission completes in well under one tick of polling.
  3. Optionally disables EngineEvents firing entirely when FASTLED_HAS_ENGINE_EVENTS is forced off via this define.

Users with cooperative WiFi/lwIP loads can leave the default behavior; users with tight-timing single-purpose sketches can opt into the fast path.

Long-term architectural fixes

  1. Driver linkage: Gate driver _build.cpp.hpp includes behind feature flags (e.g. FASTLED_ENABLE_BLE, FASTLED_ENABLE_PARLIO, FASTLED_ENABLE_LCD_CAM), default-on only for the driver chosen by the user's addLeds<> template. The current "compile everything, register everything" pattern defeats LTO and is the dominant binary-bloat driver.
  2. Wait architecture: Remove the per-show waitForReady() in onBeginFrame. The driver state should be checked lazily inside Channel::showPixels (already done at line 300) — pre-waiting in onBeginFrame is redundant and adds the tick-aligned vTaskDelay floor.
  3. Decouple fl::task from the FastLED critical path so a sketch that doesn't use HTTP/promises/coroutines doesn't pay any link/runtime cost.

Investigation TODO

  • Get .elf + .map + platformio.ini from [Bug] Compounded timing inaccuracy on master compared to 3.10.3 #2420 reporter — requested in [Bug] Compounded timing inaccuracy on master compared to 3.10.3 #2420 (comment)
  • bloaty / nm --size-sort analysis: confirm the per-driver byte cost on an actual ESP32-S3 build
  • Bisect: identify the commit where the begin-frame waitForReady() was introduced
  • Bisect: identify the commit where unconditional driver _build.cpp.hpp includes landed
  • Microbenchmark: instrument show() with esp_timer_get_time() to measure the actual blocking duration of each waitForCondition iteration on ESP32-S3 with the user's exact sketch
  • Validate proposed FASTLED_TIGHT_TIMING mitigation against the user's reproducer
  • Decide name + scope of the mitigation define and ship it
  • File follow-up issue(s) for the per-driver feature-gate refactor

Related

Labels

Suggested: type: regression, area: esp32, area: performance, area: binary-size

Activity

  1. added
    type: regression
    on Apr 30, 2026
  2. zackees commented on Apr 30, 2026

    @zackees
    MemberAuthor

    Symbol-level analysis from #2420 reporter's ELF

    @nomakewan provided the firmware.elf (41 MB w/ DWARF) and firmware.map for an ESP32-S3 build of master#ea5d8ec against the minimal NEOPIXEL sketch from #2420. Analysis used xtensa-esp32s3-elf-nm --print-size --size-sort -C and a Python parser of the linker map's per-section / per-object breakdown.

    Section sizes (from xtensa-esp32s3-elf-size -A)

    Section Bytes
    .flash.text 345,900
    .flash.rodata 359,208
    .iram0.text 79,539
    .dram0.data 16,116

    Reporter's firmware = 783 KB; baseline 3.10.3 = 344 KB; regression = +439 KB.

    libFastLED.a contribution

    Per-archive aggregation of .flash.text + .flash.rodata + .iram0.text:

    Object (unity build) text rodata iram total
    platforms+.cpp.o (all ESP32 drivers) 80,736 59,790 0 140,526
    fl.channels+.cpp.o (Channel API + manager) 39,223 21,923 7,290 68,436
    fl.audio+.cpp.o 0 34,324 0 34,324
    fl.stl+.cpp.o 8,388 16,969 0 25,357
    fl.gfx+.cpp.o 0 17,528 0 17,528
    fl.remote+.cpp.o 0 13,344 0 13,344
    third_party+.cpp.o 0 10,008 0 10,008
    fl.net+.cpp.o 0 10,008 0 10,008
    fl.fx+.cpp.o 0 9,668 0 9,668
    fl.math+.cpp.o 1,991 6,379 0 8,370
    fl.task+.cpp.o 2,050 4,123 0 6,173
    fl.system+.cpp.o 1,437 4,028 0 5,465
    libFastLED.a TOTAL ~134,800 ~208,100 ~7,400 ~350,300

    Plus main.cpp.o (FastLED template instantiations leaking into the user sketch's TU):

    • .flash.text: 1,361
    • .flash.rodata: 78,825 (huge — variant<>, PixelIterator<>, Channel-derived ClocklessIdf5<>, etc.)

    ESP-IDF driver code dragged in by FastLED's self-registration

    The Channel API instantiates one driver per family at static-init, which keeps the linker from dropping any of them. This pulls in entire ESP-IDF driver components the user never references:

    Component Pulled bytes
    UART stack (uart.c + uart_vfs.c + esp32-hal-uart) ~18,700
    SPI stack (spi_master, spi_common, esp32-hal-spi, spi_hal_iram) ~14,900
    LCD i80 (esp_lcd_panel_io_i80) ~4,863
    RMT-RX (rmt_rx.c) ~3,140
    esp32-hal-rmt, esp32-hal-periman ~4,623
    Subtotal ~46,200

    The user's NEOPIXEL sketch only needs RMT5 TX. UART, SPI master, LCD i80, RMT RX, and most hal-* code is dead weight here.

    Bloat budget reconciliation

    Bucket Bytes
    libFastLED.a (all unity objects) ~350,300
    main.cpp template explosion ~80,200
    ESP-IDF drivers transitively pulled by FastLED ~46,200
    Total FastLED-attributable ~476,700
    Reporter's measured regression +439,000

    The match is within the noise of which symbols I attribute to "FastLED-pulled" vs "would have been linked anyway" — the diagnosis is confirmed: FastLED itself accounts for the bloat, not the toolchain or platform.

    Worst offenders (priority list for fix)

    Ranked by "code that the user provably does not use":

    1. fl.audio+.cpp.o — 34 KB rodata in a NEOPIXEL sketch. No addLeds variant in the sketch references audio. Likely a static UIAudio registration or table somewhere in the include graph (we have #include "fl/audio/input.h" and #include "fl/audio/audio_processor.h" unconditionally at FastLED.h:167-168).
    2. fl.remote+.cpp.o (13 KB) + fl.net+.cpp.o (10 KB) — networking code in a sketch that does no networking. fl/channels/rx.h (FastLED.h:144) likely drags in remote+net.
    3. fl.fx+.cpp.o — 10 KB — effects library, not used.
    4. fl.gfx+.cpp.o — 17.5 KB rodata — graphics support; need to check whether NEOPIXEL templates depend on it.
    5. platforms+.cpp.o — 140 KB — confirms the unconditional driver _build.cpp.hpp hypothesis. Should be feature-gated per driver.
    6. fl.channels+.cpp.o — 68 KB — Channel API itself. The user's sketch uses one ClocklessIdf5 channel; most of this (manager, multi-driver dispatch, ChannelEvents) is overhead.
    7. main.cpp.o rodata 79 KB — template instantiation explosion in user TU. Worth investigating whether variant<ClocklessChipset, SpiChipsetConfig> and PixelIterator<...> instantiations can be moved out-of-line or merged.

    Action items added to investigation TODO

    • Get .elf + .map + platformio.ini from reporter
    • Symbol-level breakdown (this comment)
    • Identify the include-graph path that pulls fl.audio (highest single rodata consumer)
    • Identify what pulls fl.remote + fl.net
    • Check whether fl/channels/rx.h (FastLED.h:144) is the entry point for remote+net+rx
    • Decide gating strategy: opt-in defines (FASTLED_ENABLE_AUDIO, FASTLED_ENABLE_REMOTE, FASTLED_ENABLE_NET) vs opt-out (FASTLED_NO_AUDIO, etc.) vs subset header (<FastLED_Lean.h>)
    • Decide driver-gating strategy in _build.cpp.hpp: detect from addLeds<> chipset macro vs explicit per-driver enable
    • Validate proposed FASTLED_TIGHT_TIMING / lean-build define by rebuilding reporter's sketch and re-measuring binary + timing

    Tooling note

    For reproducible analysis, the script that produced the table above is in /tmp/fastled-2420-analysis/ on the maintainer's machine — uses xtensa-esp32s3-elf-nm from the pioarduino toolchain-xtensa-esp-elf package and a small Python parser of the linker .map per-section / per-object format. We should land an agents/ script or ci/ helper that does this analysis on every PR-built ESP32-S3 example to catch regressions automatically.

  3. zackees commented on Apr 30, 2026

    @zackees
    MemberAuthor

    Correction: deeper map analysis — the audio/remote/net "rodata" is actually .eh_frame

    @zackees pushed back on the previous numbers — and rightly so. I re-parsed the linker map with proper sub-section attribution (filtering --gc-sections-discarded entries at addr 0x00000000, separating .eh_frame exception-unwind data from real rodata, and accounting for the linker's merged string-literal pool .str1.1). The picture is materially different.

    What the prior analysis got wrong

    1. fl.audio / fl.remote / fl.net / fl.fx / fl.gfx contain NO actual code in the binary. Their .text contributions are zero. What I called "audio rodata" is .eh_frame exception-unwinding metadata for code that the linker dead-stripped but whose unwind data it kept.
    2. The 78 KB I attributed to main.cpp.o was actually the merged .str1.1 string-literal pool — a linker-merged region containing string literals from many TUs (mostly FastLED FL_LOG/FL_WARN/FL_ERROR/format strings), allocated at main.cpp.o's input section because that's where it appeared first.

    Corrected per-archive table (REAL bytes only, classified by category)

    Archive code rodata eh_frame mrg-str data total
    libFastLED.a(platforms+.cpp.o) 80,857 5,234 36,172 18,384 312 140,959
    main.cpp.o 1,361 247 368 78,210 2 80,188
    libFastLED.a(fl.channels+.cpp.o) 46,513 2,547 15,392 3,984 252 68,688
    libFastLED.a(fl.audio+.cpp.o) 0 0 34,324 0 0 34,324
    libFastLED.a(fl.stl+.cpp.o) 8,388 417 16,132 420 45 25,402
    libFastLED.a(fl.gfx+.cpp.o) 503 512 17,016 0 4 18,035
    libFastLED.a(fl.remote+.cpp.o) 0 0 13,344 0 0 13,344
    libesp_driver_uart.a(uart.c.obj) 10,244 491 0 1,431 176 12,342
    libFastLED.a(fl.net+.cpp.o) 0 0 10,008 0 0 10,008
    libFastLED.a(third_party+.cpp.o) 0 0 10,008 0 0 10,008
    libFastLED.a(fl.fx+.cpp.o) 0 0 9,668 0 0 9,668

    libFastLED.a roll-up

    Category Bytes % of FastLED
    code (.flash.text + .iram0.text) 142,786 (139 KB) 40%
    rodata (vtables, tables, etc.) 9,128 (9 KB) 3%
    .eh_frame (unwind metadata) 180,060 (176 KB) 51%
    merged strings (FL_LOG, etc.) 23,100 (23 KB) 6%
    data 669 <1%
    TOTAL libFastLED.a 355,743 (347 KB) 100%

    Global cross-archive overhead

    • Total .eh_frame in binary: 250,208 bytes (~244 KB) — that's 70% of the entire .flash.rodata section (which is 359 KB).
      • 180 KB from libFastLED.a TUs
      • 70 KB from Arduino + ESP-IDF
    • Total merged-strings pool: ~78 KB allocated, listed under multiple input slots in the map.

    Why audio/remote/net/fx/gfx end up linked at all (eh_frame survives, code doesn't)

    Map's "Archive member included to satisfy reference" section shows the reference chains that pull suspect TUs into the link. Once a TU is pulled in for ANY symbol, GCC's .eh_frame for that TU is retained as a single section even if --gc-sections strips all the code:

    TU pulled in Pulled by Symbol that pulled it
    fl.audio+.cpp.o src.cpp.o fl::audio::AudioManager::instance()
    fl.gfx+.cpp.o fl.channels+.cpp.o fl::rgb_2_rgbw_exact(...)
    fl.fx+.cpp.o fl.system+.cpp.o fl::Video::begin(...)
    fl.video+.cpp.o fl.fx+.cpp.o fl::video::VideoImpl::setTimeScale(...)
    fl.net+.cpp.o fl.stl+.cpp.o fl::net::http::ChunkedReader::hasChunk()
    fl.remote+.cpp.o platforms+.cpp.o fl::formatJsonResponse(...)
    third_party+.cpp.o fl.audio+.cpp.o apply_kernels

    These cross-TU references form a cascade: src → audio → third_party; channels → gfx; system → fx → video; stl → net; platforms → remote. Each new TU pulled in adds its .eh_frame to the binary even though --gc-sections strips the code.

    Corrected bloat budget vs 3.10.3

    Bucket Bytes Fixable how
    FastLED .eh_frame (exception unwind metadata) ~180 KB Build flags: -fno-exceptions -fno-asynchronous-unwind-tables (FastLED disables exceptions but doesn't suppress unwind tables)
    platforms+.cpp.o code (all 12 driver families) ~80 KB Per-driver feature gates in _build.cpp.hpp
    fl.channels+.cpp.o code (Channel API) ~47 KB Architectural — could trim manager/events
    Other ESP-IDF drivers dragged in (UART/SPI/LCD/RMT-RX) ~46 KB Stop registering drivers we don't need
    Other FastLED code (fl.stl, fl.task, fl.system, etc.) ~14 KB Acceptable
    Merged string pool (FL_LOG/FL_WARN/etc.) ~23 KB FastLED-attributable Trim log strings or gate behind verbosity
    Total FastLED-attributable ~390 KB
    Reporter's regression +439 KB Within ~50 KB margin (other Arduino/IDF eh_frame, alignment, etc.)

    Revised priorities for the fix

    1. Strip .eh_frame — biggest single win, ~180 KB. Add -fno-asynchronous-unwind-tables and -fno-unwind-tables to FastLED's compile flags (or to the user-facing lib_compile_flags in our PlatformIO templates). FastLED already uses -fno-exceptions. Need to verify whether ESP-IDF code that backtraces (panic handler, coredump) requires the system-side .eh_frame; if so, scope this to just the libFastLED.a build.
    2. Per-driver feature gates in src/platforms/esp/32/drivers/_build.cpp.hpp — recovers ~80 KB FastLED + ~46 KB ESP-IDF dependents = ~125 KB.
    3. Break the cross-TU references that drag in unrelated TUs (audio, gfx, fx, video, net, remote). Even if eh_frame is stripped, these references often pull in non-trivial code via static initialization. Need to find:
      • Why does src.cpp.o reference fl::audio::AudioManager::instance()? (Probably a CFastLED::add(UIAudio&) overload triggering ODR-use of audio singleton.)
      • Why does fl.channels reference fl::rgb_2_rgbw_exact?
      • Why does fl.stl reference fl::net::http::ChunkedReader?
      • Why does platforms reference fl::formatJsonResponse?
    4. Tight-timing path (separate from binary fixes) — still want the FASTLED_TIGHT_TIMING define to skip the per-show vTaskDelay(1) floor. That's the timing regression, independent of binary size.

    Updated TODO

    • Symbol-level breakdown with proper subsection classification
    • Identify .eh_frame as support TLS3001 #1 bloat source (~50% of rodata is unwind metadata)
    • Identify .str1.1 merged-string pool (was misattributed as "main.cpp.o" rodata)
    • Identify cross-TU reference cascade (src→audio, channels→gfx, system→fx→video, stl→net, platforms→remote)
    • Test build with -fno-asynchronous-unwind-tables on FastLED-only sources, measure size delta
    • Trace the unwanted cross-TU references in source and break them
    • Land per-driver feature gates in _build.cpp.hpp
    • Land FASTLED_TIGHT_TIMING for the per-show vTaskDelay regression

    Apologies for the misleading first-pass numbers. Lesson: when parsing GNU LD maps, always (a) filter addr 0 (gc'd), (b) separate .eh_frame from .rodata, and (c) account for the merged-strings pool being attributed to a single first-input slot.

  4. zackees commented on May 1, 2026

    @zackees
    MemberAuthor

    Concrete next-step recommendation: apply FL_NO_UNWIND via TU-level pragma to ESP32 unity-build headers

    Per the analysis above, ~180 KB of libFastLED.a's contribution to .flash.rodata is .eh_frame exception-unwind metadata, of which 79% are orphan FDEs (covering zero-byte ranges left behind after --gc-sections stripped the underlying code). The user's Arduino-ESP32 build has no clean way to pass compiler flags to FastLED sources only, so the fix needs to be source-level via GCC's #pragma GCC optimize (a per-TU mechanism that does work in Arduino builds).

    Action item

    Add a new macro FL_NO_UNWIND (separate from FL_NOEXCEPT — see discussion above for why these should not be merged) and apply via #pragma GCC push_options / #pragma GCC optimize("no-unwind-tables") / #pragma GCC pop_options to the two ESP32 unity-build headers:

    1. src/platforms/esp/32/_build.cpp.hpp — wraps condition_variable, init, io, lwip_hooks, mutex, platform_time, semaphore, watchdog, and recursively pulls in audio/, codec/, core/, drivers/, interrupts/, ota/, etc.
    2. src/platforms/esp/32/drivers/_build.cpp.hpp — wraps channel_manager_esp32, cled, spi_hw_manager_esp32, plus the 11 sub-driver families (ble, gpio_isr_rx, i2s, i2s_spi, lcd_cam, lcd_spi, parlio, rmt, rmt_rx, spi, uart). This is the file responsible for the 80 KB platforms+.cpp.o contribution to .flash.text — wrapping it strips the corresponding ~36 KB of .eh_frame for that TU and ~20-30 KB of orphan FDEs from gc'd driver code.

    Sketch of the change

    Add to src/fl/stl/codegen.h (new header, or extend an existing one):

    // FL_NO_UNWIND: suppress .eh_frame / DWARF CFI generation for the function or
    // TU it covers. ~180 KB savings on ESP32-S3 builds (most of which is orphan
    // FDEs left behind after --gc-sections strips dead virtual-dispatch code).
    //
    // SAFETY: A function compiled with this attribute cannot be unwound through
    // by the ESP32 panic handler — backtraces stop at this frame. Apply only to
    // hot dispatch / driver code where the size win matters; do NOT apply to
    // setup, loop, init, or error-handling paths where a usable backtrace matters.
    //
    // Per-function form (use sparingly):
    //   FL_NO_UNWIND void hot_dispatch() noexcept { ... }
    //
    // Preferred TU-level form (wrap a unity-build .cpp.hpp):
    //   FL_NO_UNWIND_BEGIN
    //   #include "platforms/.../_build.cpp.hpp"
    //   FL_NO_UNWIND_END
    #if defined(__GNUC__) && !defined(FASTLED_NO_OPTIMIZE_ATTR)
      #define FL_NO_UNWIND __attribute__((optimize("no-unwind-tables")))
      #define FL_NO_UNWIND_BEGIN \
          _Pragma("GCC push_options") \
          _Pragma("GCC optimize(\"no-unwind-tables\")")
      #define FL_NO_UNWIND_END \
          _Pragma("GCC pop_options")
    #else
      #define FL_NO_UNWIND
      #define FL_NO_UNWIND_BEGIN
      #define FL_NO_UNWIND_END
    #endif

    Wrap the two ESP32 unity headers:

    // src/platforms/esp/32/_build.cpp.hpp  (top of file)
    #include "fl/stl/codegen.h"
    FL_NO_UNWIND_BEGIN
    
    // existing unity includes ...
    #include "platforms/esp/32/condition_variable_esp32.cpp.hpp"
    // ... etc ...
    
    FL_NO_UNWIND_END  // (bottom of file)
    // src/platforms/esp/32/drivers/_build.cpp.hpp  (top of file)
    #include "fl/stl/codegen.h"
    FL_NO_UNWIND_BEGIN
    
    // existing unity includes ...
    #include "platforms/esp/32/drivers/channel_manager_esp32.cpp.hpp"
    // ... etc ...
    
    FL_NO_UNWIND_END  // (bottom of file)

    Expected delta

    Based on the symbol analysis of @nomakewan's master#ea5d8ec build of the #2420 minimal sketch:

    Source Current .eh_frame bytes After FL_NO_UNWIND
    libFastLED.a(platforms+.cpp.o) 36,172 ~0
    libFastLED.a(fl.audio+.cpp.o) (orphan) 34,324 ~0
    libFastLED.a(fl.gfx+.cpp.o) (orphan) 17,016 ~0
    libFastLED.a(fl.channels+.cpp.o) 15,392 ~0 (if also wrapped)
    libFastLED.a(fl.remote+.cpp.o) (orphan) 13,344 ~0
    libFastLED.a(fl.net+.cpp.o) (orphan) 10,008 ~0
    libFastLED.a(third_party+.cpp.o) (orphan) 10,008 ~0
    libFastLED.a(fl.fx+.cpp.o) (orphan) 9,668 ~0
    Other FastLED TUs ~33,000 partial (depends on which get wrapped)
    Total libFastLED.a .eh_frame 180,060 ~10-30 KB (only TUs we don't wrap)

    Estimated binary savings: 150-180 KB for the reporter's sketch, taking it from 783 KB down to ~600-630 KB. Still ~280 KB above 3.10.3 baseline (344 KB), so this is a partial fix — the per-driver feature gating (item #2 on the priority list) is needed to recover the rest.

    Phased rollout plan

    1. Phase 1 — wrap the two ESP32 unity headers (this comment's recommendation). Lowest risk, biggest single win. Driver hot-path code is already considered "no backtrace needed if it crashes you have bigger problems" territory.
    2. Phase 2 — wrap fl/channels/channel.cpp.hpp and fl/channels/manager.cpp.hpp (the Channel API itself). Adds ~15 KB savings.
    3. Phase 3 — consider wrapping the offender unity TUs that are pulled in for one symbol each (fl.audio, fl.remote, fl.net, fl.fx, fl.gfx). These contribute pure-orphan FDEs; wrapping them eliminates the spill even before we fix the cross-TU references.
    4. Phase 4 — break the cross-TU references so these TUs aren't pulled into the link at all. Better long-term fix; obsoletes Phase 3 wrapping but doesn't hurt.

    Caveats to note in the PR

    • Backtrace fidelity: ESP32 panic handler will print ??? for any frame inside a wrapped TU. Need to test what idf.py monitor / esp32_exception_decoder shows for a forced crash inside Channel::showPixels after this change. If it's unusable, scope the wrap more narrowly (e.g., only _build.cpp.hpp for drivers, not the Channel API itself).
    • GCC version dependency: #pragma GCC optimize("no-unwind-tables") is supported by GCC 4.4+. Modern Xtensa toolchains (GCC 8.4 and 13.2 in pioarduino) handle it. Safe.
    • Clang: Also accepts #pragma GCC optimize but with a warning. If FastLED supports clang-on-ESP32 (uncommon but possible), test there.
    • LTO interaction: With LTO enabled, per-TU optimize pragmas can be partially overridden. Arduino-ESP32 doesn't enable LTO by default, so this isn't an immediate concern.

    TODO update

    • NEW: Add FL_NO_UNWIND / FL_NO_UNWIND_BEGIN/_END macros to src/fl/stl/codegen.h
    • NEW: Wrap src/platforms/esp/32/_build.cpp.hpp with FL_NO_UNWIND_BEGIN/_END
    • NEW: Wrap src/platforms/esp/32/drivers/_build.cpp.hpp with FL_NO_UNWIND_BEGIN/_END
    • NEW: Build the reporter's exact sketch with the change, measure binary delta, post results back here
    • NEW: Test panic-handler backtrace through wrapped code (force a deliberate crash in Channel::showPixels, run esp32_exception_decoder, confirm output is still actionable)
    • (existing) Per-driver feature gates in _build.cpp.hpp for the remaining ~125 KB
    • (existing) Break cross-TU references that pull in audio/remote/net/fx/gfx
    • (existing) FASTLED_TIGHT_TIMING for the per-show vTaskDelay(1) regression
  5. zackees commented on May 1, 2026

    @zackees
    MemberAuthor

    Refinement: gate FL_NO_UNWIND on debug + ESP32 backtrace config

    The previous proposal would strip .eh_frame unconditionally for any function/TU it covers, breaking ESP32 panic-handler backtraces inside that code. That's fine for release builds where users want a small binary, but unacceptable for development where they need actionable crash dumps.

    The macro should be opt-in to stripping only when the build environment indicates the user is OK losing backtrace fidelity — meaning: not a debug build, and not a build that has explicitly enabled ESP-IDF backtrace printing.

    Updated macro definition

    // src/fl/stl/codegen.h
    
    // Detect "user wants backtraces" signals from the build environment:
    //
    //   FastLED debug indicators:
    //     - !defined(RELEASE)                    (FastLED's existing debug detection)
    //     - defined(FASTLED_TESTING)
    //     - defined(FASTLED_FORCE_DBG)
    //     - !defined(NDEBUG)                     (standard C/C++ debug indicator)
    //     - defined(FASTLED_DEBUG)
    //     - defined(FL_DEBUG)
    //
    //   ESP32 backtrace / panic config (sdkconfig.h):
    //     - CONFIG_ESP_SYSTEM_PANIC_PRINT_BACKTRACE  (default ON in ESP-IDF — the
    //                                                  panic handler prints a backtrace
    //                                                  on crash, requires .eh_frame to
    //                                                  be useful)
    //     - CONFIG_ESP_SYSTEM_PANIC_GDBSTUB          (GDB stub on panic — debug)
    //     - CONFIG_ESP_DEBUG_OCDAWARE                (OpenOCD-aware build — debug)
    //     - CONFIG_COMPILER_OPTIMIZATION_DEBUG       (compiled with -Og)
    //     - CONFIG_COMPILER_OPTIMIZATION_NONE        (compiled with -O0)
    //
    //   Arduino-ESP32 verbosity:
    //     - CORE_DEBUG_LEVEL >= 3  (info or higher — user wants diagnostics)
    
    // Detect debug intent
    #if !defined(RELEASE) || \
        defined(FASTLED_TESTING) || \
        defined(FASTLED_FORCE_DBG) || \
        defined(FASTLED_DEBUG) || \
        defined(FL_DEBUG) || \
        !defined(NDEBUG)
      #define FL_BUILD_WANTS_BACKTRACE 1
    #endif
    
    // Detect ESP32 panic / backtrace config
    #if defined(ESP32) || defined(ESP_PLATFORM)
      #if (defined(CONFIG_ESP_SYSTEM_PANIC_PRINT_BACKTRACE) && CONFIG_ESP_SYSTEM_PANIC_PRINT_BACKTRACE) || \
          (defined(CONFIG_ESP_SYSTEM_PANIC_GDBSTUB) && CONFIG_ESP_SYSTEM_PANIC_GDBSTUB) || \
          (defined(CONFIG_ESP_DEBUG_OCDAWARE) && CONFIG_ESP_DEBUG_OCDAWARE) || \
          (defined(CONFIG_COMPILER_OPTIMIZATION_DEBUG) && CONFIG_COMPILER_OPTIMIZATION_DEBUG) || \
          (defined(CONFIG_COMPILER_OPTIMIZATION_NONE) && CONFIG_COMPILER_OPTIMIZATION_NONE)
        #define FL_BUILD_WANTS_BACKTRACE 1
      #endif
      #if defined(CORE_DEBUG_LEVEL) && (CORE_DEBUG_LEVEL >= 3)
        #define FL_BUILD_WANTS_BACKTRACE 1
      #endif
    #endif
    
    // Allow user to explicitly force-keep or force-strip unwind tables
    #if defined(FASTLED_FORCE_UNWIND_TABLES)
      #define FL_BUILD_WANTS_BACKTRACE 1
    #endif
    #if defined(FASTLED_FORCE_NO_UNWIND_TABLES)
      #undef FL_BUILD_WANTS_BACKTRACE
    #endif
    
    // Define the actual no-op-or-strip macros
    #if defined(__GNUC__) && !defined(FL_BUILD_WANTS_BACKTRACE) && !defined(FASTLED_NO_OPTIMIZE_ATTR)
      #define FL_NO_UNWIND       __attribute__((optimize("no-unwind-tables")))
      #define FL_NO_UNWIND_BEGIN _Pragma("GCC push_options") \
                                 _Pragma("GCC optimize(\"no-unwind-tables\")")
      #define FL_NO_UNWIND_END   _Pragma("GCC pop_options")
    #else
      // Either non-GCC, or build wants backtraces — preserve unwind tables
      #define FL_NO_UNWIND
      #define FL_NO_UNWIND_BEGIN
      #define FL_NO_UNWIND_END
    #endif

    Behavior matrix (ESP32 builds)

    Build configuration FL_NO_UNWIND_BEGIN/_END Result
    Default Arduino-ESP32 release build, CORE_DEBUG_LEVEL=0, RELEASE defined, CONFIG_ESP_SYSTEM_PANIC_PRINT_BACKTRACE=y (ESP-IDF default) No-op (strips nothing) Backtraces preserved — safe default
    Same release build but user passed -DFASTLED_FORCE_NO_UNWIND_TABLES Strips Smallest binary, ~180 KB saved, no backtrace through wrapped code
    Default Arduino-ESP32 release build with CONFIG_ESP_SYSTEM_PANIC_PRINT_BACKTRACE=n (user disabled it) + no debug flags Strips User opted out of backtraces → safe to strip
    Reporter's #2420 build: CORE_DEBUG_LEVEL=3, LOG_LOCAL_LEVEL=ESP_LOG_INFO, default panic config No-op CORE_DEBUG_LEVEL>=3 triggers backtrace preservation
    FastLED unit tests / WASM: FASTLED_TESTING defined, no RELEASE No-op Debug build → preserved
    User explicitly opts in: -DFASTLED_FORCE_NO_UNWIND_TABLES Strips Override of all gates
    User wants release-with-backtrace: -DFASTLED_FORCE_UNWIND_TABLES No-op Override of all gates

    Implication for the reporter's specific case (#2420)

    platformio.ini shows -D "CORE_DEBUG_LEVEL=3" — so under this proposal, FL_NO_UNWIND would be a no-op for them by default. They'd still see the 783 KB binary unless they explicitly opt in with -DFASTLED_FORCE_NO_UNWIND_TABLES.

    That's the safest default: don't silently strip backtraces from a build that's clearly configured for diagnostics. The 783 → 600 KB win has to be opted into.

    Updated rollout for the two ESP32 unity headers

    Same files as before, just now with a debug-aware macro:

    // src/platforms/esp/32/_build.cpp.hpp  (top)
    #include "fl/stl/codegen.h"
    FL_NO_UNWIND_BEGIN
    
    #include "platforms/esp/32/condition_variable_esp32.cpp.hpp"
    // ... rest of includes ...
    
    FL_NO_UNWIND_END  // (bottom)
    // src/platforms/esp/32/drivers/_build.cpp.hpp  (top)
    #include "fl/stl/codegen.h"
    FL_NO_UNWIND_BEGIN
    
    #include "platforms/esp/32/drivers/channel_manager_esp32.cpp.hpp"
    // ... rest of includes ...
    
    FL_NO_UNWIND_END  // (bottom)

    Wrappings are conditional at preprocessing — wrap-or-not depends on the build environment's debug signals at the time the unity header is included.

    Updated TODO

    • Add FL_NO_UNWIND / FL_NO_UNWIND_BEGIN/_END to src/fl/stl/codegen.h with debug + ESP32 backtrace config gating as above
    • Wrap src/platforms/esp/32/_build.cpp.hpp with FL_NO_UNWIND_BEGIN/_END
    • Wrap src/platforms/esp/32/drivers/_build.cpp.hpp with FL_NO_UNWIND_BEGIN/_END
    • Document in agents/docs/cpp-standards.md and the ESP32 README that:
      • The default release build keeps unwind tables (safe for production debugging)
      • Users can opt into the size win with -DFASTLED_FORCE_NO_UNWIND_TABLES (~180 KB savings)
      • Users can override the gates with -DFASTLED_FORCE_UNWIND_TABLES if they need backtraces in a debug-flag-free build
    • Build the reporter's exact sketch in BOTH modes (default and -DFASTLED_FORCE_NO_UNWIND_TABLES), measure binary delta, confirm panic decoder still works in default mode
    • Test panic-handler backtrace through wrapped code in stripped mode (force a deliberate crash, run esp32_exception_decoder, document expected output)
  6. zackees commented on May 1, 2026

    @zackees
    MemberAuthor

    Status update — implementation in flight

    Landed-as-PR work

    #2423 — feat(fl/stl): add FL_NO_UNWIND macros, apply to ESP32 unity headers

    • Adds FL_NO_UNWIND / FL_NO_UNWIND_BEGIN / FL_NO_UNWIND_END to src/fl/stl/compiler_control.h (chose this over a new codegen.h since the file already hosts every other _Pragma-based macro pair in the codebase)
    • Wraps src/platforms/esp/32/_build.cpp.hpp and src/platforms/esp/32/drivers/_build.cpp.hpp
    • Debug-aware gating: macros are no-ops when ANY debug indicator is set (!RELEASE, FASTLED_TESTING, FASTLED_FORCE_DBG, FASTLED_DEBUG, FL_DEBUG, !NDEBUG), or when FL_IS_ESP32 is defined and ESP-IDF / Arduino-ESP32 indicates the user wants backtraces (CONFIG_ESP_SYSTEM_PANIC_PRINT_BACKTRACE, CONFIG_ESP_SYSTEM_PANIC_GDBSTUB, CONFIG_ESP_DEBUG_OCDAWARE, CONFIG_COMPILER_OPTIMIZATION_DEBUG, CONFIG_COMPILER_OPTIMIZATION_NONE, CORE_DEBUG_LEVEL >= 3). User can override with FASTLED_FORCE_UNWIND_TABLES / FASTLED_FORCE_NO_UNWIND_TABLES.
    • Verified: lint clean, 302/302 host tests pass, ESP32-S3 compile succeeds (810.81 KB binary in default mode — same as current master since the user's reproducer has CORE_DEBUG_LEVEL=3 which keeps unwind tables on)
    • Used FL_IS_ESP32 instead of the spec's defined(ESP32) || defined(ESP_PLATFORM) because the lint rule NativePlatformDefinesChecker forbids bare native platform defines. Strictly equivalent or broader gate.
    • Used just optimize("no-unwind-tables") (single flag) instead of the redundant pair — -fno-unwind-tables implies -fno-asynchronous-unwind-tables on GCC.
    • Restricted to FL_IS_GCC (not clang) because clang's per-function optimize attribute support is uneven.

    Filed-as-issue work

    #2424 — [Tracking] Break unwanted cross-TU references that drag optional subsystems into all builds

    • Identifies 9 specific file:line references in FastLED source where core/system code unconditionally references symbols from optional subsystems (audio, remote, net, fx, gfx, video, third_party)
    • Each entry includes: location, why-it-exists analysis, and a concrete fix recommendation
    • Headline: src/FastLED.cpp.hpp:706,711,716,721 — four CFastLED::add() overloads unconditionally reference fl::audio::AudioManager::instance(), dragging in the entire audio TU. Easy fix with #if FASTLED_HAS_AUDIO guards.
    • Full priority ranking + execution order in the issue body.

    Still in this tracking issue (no PR yet)

    What this means for @nomakewan and #2420

    Once #2423 lands, you can rebuild your sketch with -D FASTLED_FORCE_NO_UNWIND_TABLES in build_flags. Expected savings: ~150-180 KB, taking your binary from 783 KB → ~600-630 KB. Still ~280 KB above 3.10.3 baseline (344 KB), so this is a partial fix — the timing regression and the per-driver gating are both still needed for a full fix.

    Backtraces from esp32_exception_decoder will show ??? for any frame inside the wrapped TUs (the ESP32 driver code) when you opt in. If you need actionable backtraces for crash reports, leave the flag off and accept the larger binary.

  7. zackees commented on May 5, 2026

    @zackees
    MemberAuthor

    ESP32-S3 .bin symbol analysis (Blink, master)

    Compiled examples/Blink with default options (NEOPIXEL pin 3, 1 LED). Build: release, -Os. Bin = 830,304 B (matches the reporter's ~783 KB). Working from firmware.elf + firmware.bin (not just ELF — segment-level filter applied so debug/comment sections are excluded).

    Section layout of firmware.bin (LOAD-flagged PROGBITS only)

    Section Bytes %
    .flash.rodata 385,900 46.5%
    .flash.text 350,944 42.3%
    .iram0.text 76,275 9.2%
    .dram0.data 15,716 1.9%
    .iram0.vectors 1,028 0.1%
    .flash.appdesc 288 –
    .rtc.force_slow 32 –
    Total LOAD 830,183 100%

    nm-attributed bytes by category (452 KB attributed; rest is anonymous .rodata strings — see bottom)

    Category Bytes % bin
    ESP-IDF (HAL + system + drivers) 195,352 23.5%
    FastLED — total 157,832 19.0%
    libc / libgcc / newlib 52,908 6.4%
    Arduino core 1,905 0.2%

    FastLED breakdown — where the FastLED bytes actually go (158 KB total)

    Sub-category Bytes % of FL
    Channel/SPI engine 26,281 16.7%
    Channel/RMT engine + RmtMemoryManager 26,168 16.6%
    fl::* other (RMTBufferPool, gamma, etc.) 22,741 14.4%
    ChannelManager + Channel::showPixels 19,190 12.2%
    fl:: containers (vector/string/shared_ptr/HashMap) 14,496 9.2%
    Pixel/Wave transposers (wave3/wave8 in IRAM) 12,588 8.0%
    Channel/LCD_SPI driver 10,592 6.7%
    Channel/UART driver 9,993 6.3%
    Channel/I2S driver 7,449 4.7%
    fl::platforms::initChannelDrivers registry 6,254 4.0%
    Task/Coroutine/Scheduler 1,979 1.3%
    Net/HTTP detector 101 0.1%
    Channel/PARLIO 127 <0.1%

    Top 15 individual symbols in bin

    Bytes Section Symbol
    11,413 .flash.text _vfprintf_r (newlib)
    11,222 .flash.text _svfprintf_r (newlib)
    4,827 .iram0.text fl::wave3Transpose_16(...) — bit-bang transposer in IRAM
    4,640 .flash.text fl::ChannelEngineRMTImpl::createChannel(...)
    4,570 .flash.text fl::platforms::initChannelDrivers() ← the registry
    4,194 .flash.text fl::ChannelEngineSpi::createChannel(...)
    4,192 .dram0.data port_IntStack (FreeRTOS)
    3,933 .flash.text fl::Channel::showPixels(...)
    3,005 .iram0.text fl::wave8Transpose_16(...)
    2,724 .flash.text fl::RmtMemoryManager::allocateTx(...)
    2,468 .flash.text fl::ChannelEngineUART::beginTransmission(...)
    2,310 .flash.text fl::ChannelEngineSpi::acquireChannel(...)
    2,156 .flash.text fl::ChannelEngineRMTImpl::reconfigureForNetwork()
    2,150 .flash.text fl::UartPeripheralEsp::initialize(...)
    2,022 .flash.text fl::ChannelEngineI2S::beginTransmission(...)

    ESP-IDF transitively pulled in because of the Channel API

    These ESP-IDF translation units only get linked because FastLED's Channel drivers reference their entry points. None of them are needed by stock 3.10.3 RMT4 path.

    Bytes TU Pulled in by
    6,077 esp_driver_rmt/rmt_tx.c RMT5 driver
    5,679 esp_hw_support/dma/gdma.c RMT5/I2S/PARLIO drivers
    5,147 esp_driver_spi/spi_master.c SPI Channel engine
    4,949 esp_lcd/i80/esp_lcd_panel_io_i80.c LCD_SPI driver
    3,958 esp_driver_spi/spi_common.c SPI Channel engine
    3,836 esp_driver_rmt/rmt_rx.c RMT_RX driver — completely unused for Blink
    3,479 espcoredump/core_dump_elf.c (default IDF; not new)
    3,116 esp_driver_gpio/gpio.c (mostly always-needed)
    2,896 esp32-hal-uart.c Arduino Serial + UART driver

    Subtotal of "pulled by Channel API": ~30 KB of ESP-IDF code that 3.10.3 wouldn't have linked.

    .flash.rodata — the 365 KB elephant

    .flash.rodata is 385,900 B, but nm / objdump -t only attribute 21,208 B to named symbols (vtables, gamma LUTs, error tables). The remaining ~365 KB is anonymous string literals — predominantly ESP-IDF ESP_LOGE / ESP_LOGW / ESP_LOGI format strings + filenames + function names from each __func__ artifact. Each driver TU pulled in adds its own log/error strings here.

    Top named rodata symbols:

    Bytes Symbol
    1,856 esp_err_msg_table
    1,232 rtc_io_desc
    512 intr_desc_table
    512 fl::ProgmemLUT16<fl::GammaEval16<...>, 256>::kData
    396 esp_isr_names
    256 m_CRC7Table, __chclass
    200 soc_memory_regions, __mprec_tens
    88 vtables for VFSFileImpl, fl::Rmt5PeripheralESPImpl, fl::LcdSpiPeripheralEsp, ...

    Conclusion (what's confirmed vs. the issue's hypothesis)

    • The hypothesis in the issue body is confirmed. src/platforms/esp/32/drivers/_build.cpp.hpp unconditionally #includes every driver family (ble, gpio_isr_rx, i2s, i2s_spi, lcd_cam, lcd_spi, parlio, rmt, rmt_rx, spi, uart). Each driver's static registration in ChannelManager::mDrivers defeats --gc-sections, so the linker keeps them all.
    • For a NEOPIXEL-only Blink sketch, only the RMT driver is actually exercised at runtime, but the bin contains the full code for at least: SPI engine (26 KB), LCD_SPI (11 KB), UART (10 KB), I2S (7 KB), plus the Channel core / containers / platforms registry (~46 KB) — call it ~100 KB of FastLED dead code that LTO can't strip.
    • Cascading from those drivers, ESP-IDF then links ~30 KB of HAL TUs (rmt_rx.c, esp_lcd_panel_io_i80.c, spi_master.c, gdma.c, ...) plus their rodata log strings which dominate the otherwise-mysterious 365 KB anonymous-rodata bulge.
    • Approximate dead-weight that could be removed by feature-gating drivers: ~100 KB FastLED + ~30 KB ESP-IDF code + a sizable but harder-to-quantify slice of the 365 KB anonymous rodata (every logging string in those TUs goes away with the TU).

    Tooling used: xtensa-esp32s3-elf-{nm,readelf,objdump,addr2line,c++filt} + two helper scripts I added at ci/bin_bloat_analysis.py (regex categorization) and ci/bin_bloat_attribute.py (addr2line source-file attribution). They take only the firmware.elf + section LOAD-flag map as input, so the same scripts will work on the reporter's binary from #2420 once they upload it.

  8. zackees commented on May 9, 2026

    @zackees
    MemberAuthor

    Filed #2428 as the proposed source-level fix for the binary-bloat half of this tracker. Compile-time Bus binding via templated ChannelConfig<Chipset> so only the named driver(s) survive the linker — NEOPIXEL-only sketches should drop back to the ~344 KB 3.10.3 baseline. Also removes the manager-side vTaskDelay(1) floor in the default path (manager moves to opt-in enableDrivers<...>()).

  9. 5 remaining items

  10. reopened this on Jun 8, 2026
  11. zackees commented on Jun 8, 2026

    @zackees
    MemberAuthor

    @nomakewan as you can see from the flurry of PR's I've focused on the binary bloat over the last few days. Feel free to give it a spin.

    Image
  12. nomakewan commented on Jun 8, 2026

    @nomakewan
    Contributor

    @nomakewan as you can see from the flurry of PR's I've focused on the binary bloat over the last few days. Feel free to give it a spin.

    On the test program from #2420, the code from master#91602d5 gives a binary size of 633KB with CORE_DEBUG_LEVEL=0 and LOG_LOCAL_LEVEL=ESP_LOG_NONE, and a binary size of 644KB with CORE_DEBUG_LEVEL=3 and LOG_LOCAL_LEVEL=ESP_LOG_INFO

    A significant improvement over the initial 768KB/783KB, but still not quite as lean 'n' mean as 3.10.3's 330KB/344KB.

    EDIT: Just for reference, updating the framework to Arduino-ESP32 3.3.9 increased the binary size by ~1KB. So 3.10.3 on 3.3.9 went up to 331/345KB. So moving to the latest-and-greatest ESP-IDF did not meaningfully increase the binary sizes.

  13. zackees commented on Jun 8, 2026

    @zackees
    MemberAuthor

    Can you swap out platformio with fbuild and tell me what your numbers are. Platformio wants to insert exception handling frames where a lot of the bloat is coming from. fbuild does the right thing.

    pip install fbuild

    fbuild is a drop in replacement, all the platformio commands work, and will work with your platformio.ini

  14. nomakewan commented on Jun 8, 2026

    @nomakewan
    Contributor

    My apologies, but I am not willing to do that, just as I am not willing to swap out our timekeeping functions with FastLED's either.

    My stance is that this setup worked previously with any timekeeping function in the Arduino ecosystem and that compiling worked both on the Arduino IDE as well as vanilla PlatformIO without bloat. FastLED, in my opinion, should continue to do the same as it has in the past. An addressable LED control library should be agnostic of non-addressable-LED-related user code as well as build environment.

  15. zackees commented on Jun 9, 2026

    @zackees
    MemberAuthor

    The bloat you are seeing is coming from PlatformIO injecting exception-handling frames, even when the affected functions are not actually used.

    There is no library-side fix for that.

    The only workaround is to suppress those sections with SCons build flags in platformio.ini. But if you do that, good luck getting a useful crash dump when something goes wrong.

    I have already rewritten the Channels API so drivers are only selectively included. I added FL_NOEXCEPT across the codebase. I have done the work. It does not solve this, because the problem is not the API. The problem is the build tool.

    What you are asking for is not reasonable.

    FastLED 4.0 is going to be the most important release this project has ever had. I am not going to fork the entire codebase, compromise the architecture, and punish every other user because replacing a broken build tool with a real professional build tool is "too much for you".

  16. moved this from Triage to Done in FastLED Trackeron Jun 9, 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

    type: regression

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions