Skip to content

fix(esp32): resolve SPI/LCD_SPI buffer growth failure on channel reuse - #2251

Merged
zackees merged 1 commit into
masterfrom
fix-lcd-spi-buffer-growth-2249
Apr 11, 2026
Merged

zackees merged 1 commit into
masterfrom
fix-lcd-spi-buffer-growth-2249

Conversation

@zackees

@zackees zackees commented Apr 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fix SPI/LCD_SPI driver failure when strip size changes between FastLED.clear() + FastLED.add() cycles
  • Root cause: Channel constructor called fl::pinMode(pin, InputPulldown) which disconnected the SPI MOSI from the GPIO matrix, breaking the persistent SPI driver's output
  • Harden LCD_SPI peripheral with semaphore-based synchronization, lazy panel IO recreation on size change, and explicit PSRAM cache sync

Closes #2249

Changes

File Change
channel.cpp.hpp Remove fl::pinMode(InputPulldown) from all 3 Channel constructors — the driver configures the pin
channel_driver_spi.cpp.hpp Reallocate ledSourceBuffer on channel reuse when data exceeds existing buffer
lcd_spi_peripheral_esp.cpp.hpp Semaphore priming, blocking wait, lazy panel IO with size-based recreation, esp_cache_msync
lcd_spi_peripheral_esp.h Add mLastTransmitSize field for tracking transaction size changes
rmt_rx_channel.cpp.hpp Reset mAccumulationOffset in clear() to prevent stale write position on re-arm

Test plan

  • 298/298 host unit tests pass
  • bash autoresearch --spi --strip-sizes 100,250 — both pass
  • bash autoresearch --spi --strip-sizes 100,250,100 — all 3 pass (round-trip)
  • bash autoresearch --spi --strip-sizes 250 — standalone pass
  • bash autoresearch --i2s — verify I2S LCD_CAM driver unaffected
  • bash autoresearch --all — full driver matrix

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed RMT receive channel state reset to properly clear accumulation offset.
    • Improved SPI channel buffer reallocation for reused channels with larger data transfers.
  • Improvements

    • Enhanced LCD display driver with optimized DMA completion handling and PSRAM cache synchronization support.
    • Improved pin configuration timing for channel initialization.

#2249)

Root cause: Channel constructor called fl::pinMode(pin, InputPulldown) which
reconfigured the SPI MOSI pin as GPIO input, disconnecting the SPI peripheral
from the GPIO matrix. After FastLED.clear(ClearFlags::CHANNELS) + FastLED.add(),
the new Channel's constructor broke the persistent SPI driver's GPIO routing.

Fixes:
- Remove fl::pinMode(InputPulldown) from all Channel constructors — the driver
  configures the pin when it first uses it
- ChannelEngineSpi: reallocate ledSourceBuffer on reuse when new data exceeds
  existing buffer (prevents ISR-unsafe direct PSRAM fallback)
- LCD_SPI peripheral: prime semaphore, blocking wait before transmit, lazy panel
  IO creation with recreation on size change, explicit esp_cache_msync for PSRAM
- RMT RX: reset mAccumulationOffset in clear() to prevent stale write position

Validated: bash autoresearch --spi --strip-sizes 100,250,100 — all pass.
@coderabbitai

coderabbitai Bot commented Apr 11, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Changes address LCD_SPI driver buffer growth failures on ESP32-S3 by refactoring pin initialization away from Channel constructors, implementing lazy panel IO creation with buffer-aware recreation, adding PSRAM cache synchronization, replacing non-blocking semaphore drains with blocking DMA waits, and enabling SPI channel buffer reallocation on size increases.

Changes

Cohort / File(s) Summary
Pin Configuration Refactoring
src/fl/channels/channel.cpp.hpp
Removed fl::pinMode(..., InputPulldown) calls from Channel constructors; pin configuration now deferred to driver initialization.
LCD_SPI Peripheral Enhancements
src/platforms/esp/32/drivers/lcd_spi/lcd_spi_peripheral_esp.h, lcd_spi_peripheral_esp.cpp.hpp
Added mLastTransmitSize state tracking; changed initialize() to skip mPanelIo creation; modified transmit() to lazily (re)create mPanelIo when size changes, perform cache synchronization, and block on DMA completion semaphore instead of draining.
RMT RX Accumulation Reset
src/platforms/esp/32/drivers/rmt_rx/rmt_rx_channel.cpp.hpp
Added clearing of mAccumulationOffset in clear() method to properly reinitialize receive buffer write position.
SPI Channel Buffer Reallocation
src/platforms/esp/32/drivers/spi/channel_driver_spi.cpp.hpp
Implemented conditional buffer reallocation in acquireChannel() when reusing idle SPI channels with larger incoming LED data, including old buffer deallocation and allocation failure logging.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application
    participant LcdSpi as LcdSpiPeripheralEsp
    participant PanelIo as PanelIo Instance
    participant Cache as Cache Manager
    participant GDMA as GDMA/DMA

    App->>LcdSpi: transmit(buffer, size_bytes)
    alt size_bytes changed
        LcdSpi->>PanelIo: delete old mPanelIo
        LcdSpi->>PanelIo: create new mPanelIo with new size
    end
    
    LcdSpi->>Cache: esp_cache_msync() for buffer
    Note over Cache: Flush PSRAM writes to DMA-visible state
    
    LcdSpi->>GDMA: esp_lcd_panel_io_tx_color(buffer, size)
    GDMA-->>LcdSpi: queued (returns ESP_OK)
    
    LcdSpi->>LcdSpi: xSemaphoreTake(mCompleteSem, 2000ms)
    Note over LcdSpi: Block until DMA completion signal
    GDMA-->>LcdSpi: xSemaphoreGive() on DMA done
    
    LcdSpi->>LcdSpi: mLastTransmitSize = size_bytes
    LcdSpi-->>App: transfer complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hops through the buffer with joy and cheer,
Lazy creation, no reinit fear!
Cache syncs dance, DMA waits so true,
Growth paths mended — ESP32-S3 shines through! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main issue: fixing an ESP32 SPI/LCD_SPI buffer growth failure during channel reuse.
Linked Issues check ✅ Passed The code changes address all coding objectives from issue #2249: removing pinMode(InputPulldown) from Channel constructors, reallocating ledSourceBuffer on reuse, adding semaphore priming and cache sync for LCD_SPI, and resetting mAccumulationOffset in RMT RX.
Out of Scope Changes check ✅ Passed All changes directly address the root causes identified in issue #2249 (GPIO matrix disconnection, buffer sizing, cache coherence, and RX offset) with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-lcd-spi-buffer-growth-2249

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 980.46ms

Top 5 Slowest Headers

  1. FastLED.h - 740.39ms
  2. fl/fastled.h - 313.64ms
  3. fl/task/executor.h - 239.23ms
  4. crgb.h - 173.32ms
  5. fl/gfx/crgb.h - 172.09ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (740.4ms)
⚠️ Header fl/fastled.h exceeds 150ms (313.6ms)
⚠️ Header fl/task/executor.h exceeds 150ms (239.2ms)
⚠️ Header crgb.h exceeds 150ms (173.3ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (172.1ms)
⚠️ Header fl/math/ease.h exceeds 150ms (167.8ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (165.9ms)
⚠️ Header fl/task/scheduler.h exceeds 50ms (125.5ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (116.9ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (116.2ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (115.2ms)
⚠️ Header platforms/thread.h exceeds 50ms (115.1ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (115.1ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (115.0ms)
⚠️ Header fl/ui.h exceeds 50ms (105.2ms)
⚠️ Header fl/task/promise.h exceeds 50ms (101.7ms)
⚠️ Header fl/stl/json.h exceeds 50ms (67.5ms)
⚠️ Header fl/stl/function.h exceeds 50ms (60.2ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (53.3ms)
⚠️ Template instantiation time is high (51.9%)

Full Report
================================================================================
FASTLED COMPILATION PERFORMANCE REPORT
================================================================================
Generated: 2026-04-11 06:12:52
Compiler: clang++-17
File: ci/perf/test_compile.cpp

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    1,574.94 ms
Frontend Time:             14.22 ms (0.9%)
Backend Time:              96.02 ms (6.1%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    10149.76 ms (644.5%)
Templates                   503.00 ms ( 31.9%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1220.0 ms - FastLED.h (SLOW)
   659.3 ms - fl/task/executor.h (SLOW)
   357.5 ms - fl/fastled.h (SLOW)
   345.4 ms - fl/task/promise.h (SLOW)
   304.2 ms - fl/stl/function.h (SLOW)
   301.8 ms - fl/task/scheduler.h (SLOW)
   293.0 ms - fl/stl/singleton.h (SLOW)
   292.3 ms - fl/stl/thread_local.h (SLOW)
   291.2 ms - fl/stl/thread.h (SLOW)
   291.2 ms - platforms/thread.h (SLOW)
   291.1 ms - platforms/stub/thread_stub.h (SLOW)
   291.0 ms - platforms/stub/thread_stub_stl.h (SLOW)
   192.0 ms - crgb.h (SLOW)
   190.8 ms - fl/gfx/crgb.h (SLOW)
   186.6 ms - fl/math/ease.h (SLOW)
   184.7 ms - fl/math/fixed_point.h (SLOW)
   158.7 ms - fl/stl/vector.h (SLOW)
   126.7 ms - fl/math/math.h (SLOW)
   122.3 ms - fl/stl/undef.h (SLOW)
   102.5 ms - fl/ui.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1220.0ms)
  ├─  659.3 ms - fl/task/executor.h
  │ ├─  345.4 ms - fl/task/promise.h
  │ │ ├─  304.2 ms - fl/stl/function.h
  │ │ │ ├─  158.7 ms - fl/stl/vector.h
  │ │ │ │ ├─  126.7 ms - fl/math/math.h
  │ │ │ │ │ └─  122.3 ms - fl/stl/undef.h
  │ │ │ │ │   └─  225.9 ms - stdlib.h
  │ │ │ │ │     ├─  115.1 ms - cstdlib
  │ │ │ │ │     │ └─  225.9 ms - stdlib.h
  │ │ │ │ │     │   ├─  115.1 ms - cstdlib
  │ │ │ │ │     │   ├─   62.3 ms - types.h
  │ │ │ │ │     │   ├─    4.2 ms - locale_t.h
  │ │ │ │ │     │   └─    4.0 ms - floatn.h
  │ │ │ │ │     ├─   62.3 ms - types.h
  │ │ │ │ │     │ ├─   62.3 ms - types.h
  │ │ │ │ │     │ │ ├─   62.3 ms - types.h
  │ │ │ │ │     │ │ ├─   11.5 ms - select.h
  │ │ │ │ │     │ │ ├─    7.9 ms - endian.h
  │ │ │ │ │     │ │ └─    7.7 ms - pthreadtypes.h
  │ │ │ │ │     │ ├─   11.5 ms - select.h
  │ │ │ │ │     │ ├─    7.9 ms - endian.h
  │ │ │ │ │     │ └─    7.7 ms - pthreadtypes.h
  │ │ │ │ │     │   └─    7.2 ms - thread-shared-types.h
  │ │ │ │ │     ├─    4.2 ms - locale_t.h
  │ │ │ │ │     └─    4.0 ms - floatn.h
  │ │ │ │ ├─   15.2 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   10.4 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    6.7 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    1.8 ms - fl/stl/unique_ptr.h
  │ │ │ │ ├─    7.7 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.3 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ │ ├─   65.2 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   54.4 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   49.4 ms - fl/stl/move.h
  │ │ │ │ ├─    6.5 ms - fl/stl/atomic.h
  │ │ │ │ │ └─    5.7 ms - platforms/atomic.h
  │ │ │ │ │   └─    5.7 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ │ ├─   61.8 ms - fl/stl/variant.h
  │ │ │ │ └─   60.2 ms - fl/stl/new.h
  │ │ │ │   └─   60.2 ms - platforms/new.h
  │ │ │ │     └─   60.2 ms - platforms/shared/new.h
  │ │ │ │       └─   56.3 ms - new
  │ │ │ │         ├─   42.6 ms - c++config.h
  │ │ │ │         │ └─   37.7 ms - os_defines.h
  │ │ │ │         └─    0.5 ms - version.h
  │ │ │ ├─   10.1 ms - fl/stl/compiler_control.h
  │ │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │ │   └─    1.6 ms - fl/math/random.h
  │ │ │     └─    0.8 ms - fl/math/random8.h
  │ │ └─   36.6 ms - fl/stl/string.h
  │ │   ├─   11.0 ms - fl/stl/basic_string.h
  │ │   │ ├─    0.9 ms - fl/stl/iterator.h
  │ │   │ └─    0.9 ms - fl/stl/not_null.h
  │ │   ├─    6.9 ms - fl/stl/span.h
  │ │   │ └─    2.9 ms - fl/math/geometry.h
  │ │   ├─    4.3 ms - fl/stl/string_view.h
  │ │   └─    1.3 ms - fl/stl/optional.h
  │ ├─  301.8 ms - fl/task/scheduler.h
  │ │ ├─  293.0 ms - fl/stl/singleton.h
  │ │ │ └─  292.3 ms - fl/stl/thread_local.h
  │ │ │   └─  291.2 ms - fl/stl/thread.h
  │ │ │     └─  291.2 ms - platforms/thread.h
  │ │ │       └─  291.1 ms - platforms/stub/thread_stub.h
  │ │ │         └─  291.0 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  286.3 ms - thread
  │ │ │             ├─  163.7 ms - std_thread.h
  │ │ │             └─  109.5 ms - this_thread_sleep.h
  │ │ └─    8.0 ms - fl/task/task.h
  │ │   └─    3.1 ms - fl/trace.h
  │ │     ├─    2.0 ms - fl/stl/chrono.h
  │ │     └─    0.8 ms - fl/stl/tuple.h
  │ ├─   10.0 ms - platforms/await.h
  │ │ └─    9.7 ms - platforms/coroutine_runtime.h
  │ │   └─    8.2 ms - fl/system/engine_events.h
  │ │     ├─    4.1 ms - fl/math/screenmap.h
  │ │     │ └─    2.9 ms - fl/stl/flat_map.h
  │ │     └─    2.7 ms - fl/math/xymap.h
  │ │       └─    0.7 ms - fl/math/lut.h
  │ └─    0.7 ms - fl/task/promise_result.h
  ├─  357.5 ms - fl/fastled.h
  │ ├─  192.0 ms - crgb.h
  │ │ ├─  190.8 ms - fl/gfx/crgb.h
  │ │ │ └─  186.6 ms - fl/math/ease.h
  │ │ │   └─  184.7 ms - fl/math/fixed_point.h
  │ │ │     ├─   66.7 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─   49.9 ms - fl/math/sin32.h
  │ │ │     │ │ └─   47.3 ms - fl/math/simd.h
  │ │ │     │ │   └─   46.8 ms - fl/math/simd/types.h
  │ │ │     │ │     └─   46.5 ms - platforms/simd.h
  │ │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.7 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   14.7 ms - fl/math/fixed_point/s16x16.h
  │ │ │     ├─   14.7 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   14.5 ms - fl/math/fixed_point/s8x24.h
  │ │ │     └─   14.4 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.8 ms - chsv.h
  │ │   └─    0.7 ms - fl/gfx/hsv.h
  │ ├─   73.0 ms - platforms.h
  │ │ └─   73.0 ms - platforms/stub/fastled_stub.h
  │ │   ├─   40.6 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   40.6 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   34.9 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   32.9 ms - fl/id_tracker.h
  │ │   │   │   └─   32.0 ms - fl/stl/mutex.h
  │ │   │   │     └─   31.9 ms - platforms/mutex.h
  │ │   │   │       └─   31.7 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.3 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   32.3 ms - platforms/stub/clockless_stub.h
  │ │     └─   32.3 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   11.5 ms - fl/channels/data.h
  │ │       │ └─    8.4 ms - fl/channels/config.h
  │ │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.1 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.3 ms - fl/chipsets/spi.h
  │ │       ├─   11.1 ms - fl/system/log.h
  │ │       │ └─   10.7 ms - fl/stl/strstream.h
  │ │       ├─    2.2 ms - fl/channels/manager.h
  │ │       ├─    1.4 ms - fl/stl/weak_ptr.h
  │ │       └─    1.0 ms - fl/channels/driver.h
  │ ├─   34.7 ms - colorutils.h
  │ │ └─   33.9 ms - fl/gfx/colorutils.h
  │ │   ├─    7.6 ms - fl/gfx/blur.h
  │ │   │ └─    4.1 ms - fl/gfx/canvas.h
  │ │   │   └─    2.5 ms - fl/math/alpha.h
  │ │   └─    2.7 ms - fl/gfx/fill.h
  │ ├─   20.2 ms - pixel_controller.h
  │ │ ├─   14.6 ms - pixel_iterator.h
  │ │ │ └─   14.4 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    4.2 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    3.2 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    2.6 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    4.0 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.3 ms - rgbw.h
  │ │   └─    2.2 ms - fl/gfx/rgbw.h
  │ └─   18.3 ms - pixeltypes.h
  │   ├─   15.2 ms - lib8tion.h
  │   │ ├─    7.7 ms - fl/math/math8.h
  │   │ │ ├─    4.0 ms - fl/math/intmap.h
  │   │ │ │ └─    3.1 ms - platforms/intmap.h
  │   │ │ ├─    2.0 ms - fl/math/scale8.h
  │   │ │ │ └─    1.9 ms - platforms/scale8.h
  │   │ │ │   └─    0.8 ms - platforms/shared/scale8.h
  │   │ │ └─    1.6 ms - platforms/math8.h
  │   │ │   └─    1.2 ms - platforms/shared/math8.h
  │   │ └─    1.6 ms - fl/math/beat.h
  │   │   └─    0.9 ms - fl/math/trig8.h
  │   │     └─    0.9 ms - platforms/trig8.h
  │   │       └─    0.8 ms - platforms/shared/trig8.h
  │   └─    2.7 ms - crgb.hpp
  ├─  102.5 ms - fl/ui.h
  │ ├─   64.7 ms - fl/stl/json.h
  │ │ └─   50.5 ms - fl/stl/json/types.h
  │ │   └─    6.2 ms - fl/stl/limits.h
  │ ├─    9.7 ms - fl/ui_impl.h
  │ │ └─    9.1 ms - platforms/ui_defs.h
  │ │   ├─    2.0 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    1.0 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.4 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/checkbox.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/help.h
  │ │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  │ └─    4.9 ms - fl/stl/url.h
  ├─   24.3 ms - chipsets.h
  │ ├─    9.9 ms - fl/chipsets/ucs7604.h
  │ │ └─    7.4 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    5.7 ms - fl/chipsets/apa102.h
  │ ├─    1.6 ms - fl/chipsets/lpd880x.h
  │ ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
  │ └─    0.7 ms - fl/chipsets/p9813.h
  └─   19.9 ms - fl/audio/audio_processor.h
    ├─    5.2 ms - fl/audio/audio_context.h
    │ └─    1.5 ms - fl/audio/fft/fft.h
    ├─    1.6 ms - fl/audio/detector/vibe.h
    └─    0.8 ms - fl/audio/signal_conditioner.h
fl/task/executor.h (659.3ms)
  ├─  345.4 ms - fl/task/promise.h
  │ ├─  304.2 ms - fl/stl/function.h
  │ │ ├─  158.7 ms - fl/stl/vector.h
  │ │ │ ├─  126.7 ms - fl/math/math.h
  │ │ │ │ └─  122.3 ms - fl/stl/undef.h
  │ │ │ │   └─  225.9 ms - stdlib.h
  │ │ │ │     ├─  115.1 ms - cstdlib
  │ │ │ │     │ └─  225.9 ms - stdlib.h
  │ │ │ │     │   ├─  115.1 ms - cstdlib
  │ │ │ │     │   │ └─  225.9 ms - stdlib.h
  │ │ │ │     │   ├─   62.3 ms - types.h
  │ │ │ │     │   │ ├─   62.3 ms - types.h
  │ │ │ │     │   │ ├─   11.5 ms - select.h
  │ │ │ │     │   │ ├─    7.9 ms - endian.h
  │ │ │ │     │   │ └─    7.7 ms - pthreadtypes.h
  │ │ │ │     │   ├─    4.2 ms - locale_t.h
  │ │ │ │     │   └─    4.0 ms - floatn.h
  │ │ │ │     ├─   62.3 ms - types.h
  │ │ │ │     │ ├─   62.3 ms - types.h
  │ │ │ │     │ │ ├─   62.3 ms - types.h
  │ │ │ │     │ │ │ ├─   62.3 ms - types.h
  │ │ │ │     │ │ │ ├─   11.5 ms - select.h
  │ │ │ │     │ │ │ ├─    7.9 ms - endian.h
  │ │ │ │     │ │ │ └─    7.7 ms - pthreadtypes.h
  │ │ │ │     │ │ ├─   11.5 ms - select.h
  │ │ │ │     │ │ ├─    7.9 ms - endian.h
  │ │ │ │     │ │ └─    7.7 ms - pthreadtypes.h
  │ │ │ │     │ │   └─    7.2 ms - thread-shared-types.h
  │ │ │ │     │ ├─   11.5 ms - select.h
  │ │ │ │     │ ├─    7.9 ms - endian.h
  │ │ │ │     │ └─    7.7 ms - pthreadtypes.h
  │ │ │ │     │   └─    7.2 ms - thread-shared-types.h
  │ │ │ │     ├─    4.2 ms - locale_t.h
  │ │ │ │     └─    4.0 ms - floatn.h
  │ │ │ ├─   15.2 ms - fl/stl/allocator.h
  │ │ │ │ └─   10.4 ms - fl/stl/bitset.h
  │ │ │ │   └─    6.7 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    1.8 ms - fl/stl/unique_ptr.h
  │ │ │ ├─    7.7 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.3 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ ├─   65.2 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   54.4 ms - fl/stl/type_traits.h
  │ │ │ │ └─   49.4 ms - fl/stl/move.h
  │ │ │ ├─    6.5 ms - fl/stl/atomic.h
  │ │ │ │ └─    5.7 ms - platforms/atomic.h
  │ │ │ │   └─    5.7 ms - platforms/shared/atomic.h
  │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ ├─   61.8 ms - fl/stl/variant.h
  │ │ │ └─   60.2 ms - fl/stl/new.h
  │ │ │   └─   60.2 ms - platforms/new.h
  │ │ │     └─   60.2 ms - platforms/shared/new.h
  │ │ │       └─   56.3 ms - new
  │ │ │         ├─   42.6 ms - c++config.h
  │ │ │         │ └─   37.7 ms - os_defines.h
  │ │ │         │   └─   34.2 ms - features.h
  │ │ │         └─    0.5 ms - version.h
  │ │ ├─   10.1 ms - fl/stl/compiler_control.h
  │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │   └─    1.6 ms - fl/math/random.h
  │ │     └─    0.8 ms - fl/math/random8.h
  │ └─   36.6 ms - fl/stl/string.h
  │   ├─   11.0 ms - fl/stl/basic_string.h
  │   │ ├─    0.9 ms - fl/stl/iterator.h
  │   │ └─    0.9 ms - fl/stl/not_null.h
  │   ├─    6.9 ms - fl/stl/span.h
  │   │ └─    2.9 ms - fl/math/geometry.h
  │   ├─    4.3 ms - fl/stl/string_view.h
  │   └─    1.3 ms - fl/stl/optional.h
  ├─  301.8 ms - fl/task/scheduler.h
  │ ├─  293.0 ms - fl/stl/singleton.h
  │ │ └─  292.3 ms - fl/stl/thread_local.h
  │ │   └─  291.2 ms - fl/stl/thread.h
  │ │     └─  291.2 ms - platforms/thread.h
  │ │       └─  291.1 ms - platforms/stub/thread_stub.h
  │ │         └─  291.0 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  286.3 ms - thread
  │ │             ├─  163.7 ms - std_thread.h
  │ │             │ ├─   48.8 ms - tuple
  │ │             │ ├─   28.7 ms - iosfwd
  │ │             │ ├─   26.1 ms - gthr.h
  │ │             │ ├─   17.7 ms - refwrap.h
  │ │             │ └─    8.1 ms - unique_ptr.h
  │ │             └─  109.5 ms - this_thread_sleep.h
  │ │               ├─   79.0 ms - chrono.h
  │ │               └─   23.0 ms - cerrno
  │ └─    8.0 ms - fl/task/task.h
  │   └─    3.1 ms - fl/trace.h
  │     ├─    2.0 ms - fl/stl/chrono.h
  │     └─    0.8 ms - fl/stl/tuple.h
  ├─   10.0 ms - platforms/await.h
  │ └─    9.7 ms - platforms/coroutine_runtime.h
  │   └─    8.2 ms - fl/system/engine_events.h
  │     ├─    4.1 ms - fl/math/screenmap.h
  │     │ └─    2.9 ms - fl/stl/flat_map.h
  │     └─    2.7 ms - fl/math/xymap.h
  │       └─    0.7 ms - fl/math/lut.h
  └─    0.7 ms - fl/task/promise_result.h
fl/fastled.h (357.5ms)
  ├─  192.0 ms - crgb.h
  │ ├─  190.8 ms - fl/gfx/crgb.h
  │ │ └─  186.6 ms - fl/math/ease.h
  │ │   └─  184.7 ms - fl/math/fixed_point.h
  │ │     ├─   66.7 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─   49.9 ms - fl/math/sin32.h
  │ │     │ │ └─   47.3 ms - fl/math/simd.h
  │ │     │ │   └─   46.8 ms - fl/math/simd/types.h
  │ │     │ │     └─   46.5 ms - platforms/simd.h
  │ │     │ │       └─   46.5 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.7 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   14.7 ms - fl/math/fixed_point/s16x16.h
  │ │     ├─   14.7 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   14.5 ms - fl/math/fixed_point/s8x24.h
  │ │     └─   14.4 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.8 ms - chsv.h
  │   └─    0.7 ms - fl/gfx/hsv.h
  ├─   73.0 ms - platforms.h
  │ └─   73.0 ms - platforms/stub/fastled_stub.h
  │   ├─   40.6 ms - platforms/stub/fastspi_stub.h
  │   │ └─   40.6 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   34.9 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   32.9 ms - fl/id_tracker.h
  │   │   │   └─   32.0 ms - fl/stl/mutex.h
  │   │   │     └─   31.9 ms - platforms/mutex.h
  │   │   │       └─   31.7 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   31.7 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.3 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   32.3 ms - platforms/stub/clockless_stub.h
  │     └─   32.3 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   11.5 ms - fl/channels/data.h
  │       │ └─    8.4 ms - fl/channels/config.h
  │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.1 ms - fl/chipsets/led_timing.h
  │       │   └─    1.3 ms - fl/chipsets/spi.h
  │       ├─   11.1 ms - fl/system/log.h
  │       │ └─   10.7 ms - fl/stl/strstream.h
  │       ├─    2.2 ms - fl/channels/manager.h
  │       ├─    1.4 ms - fl/stl/weak_ptr.h
  │       └─    1.0 ms - fl/channels/driver.h
  ├─   34.7 ms - colorutils.h
  │ └─   33.9 ms - fl/gfx/colorutils.h
  │   ├─    7.6 ms - fl/gfx/blur.h
  │   │ └─    4.1 ms - fl/gfx/canvas.h
  │   │   └─    2.5 ms - fl/math/alpha.h
  │   └─    2.7 ms - fl/gfx/fill.h
  ├─   20.2 ms - pixel_controller.h
  │ ├─   14.6 ms - pixel_iterator.h
  │ │ └─   14.4 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    4.2 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    3.2 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    2.6 ms - fl/gfx/gamma_lut.h
  │ │   ├─    4.0 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.3 ms - rgbw.h
  │   └─    2.2 ms - fl/gfx/rgbw.h
  └─   18.3 ms - pixeltypes.h
    ├─   15.2 ms - lib8tion.h
    │ ├─    7.7 ms - fl/math/math8.h
    │ │ ├─    4.0 ms - fl/math/intmap.h
    │ │ │ └─    3.1 ms - platforms/intmap.h
    │ │ ├─    2.0 ms - fl/math/scale8.h
    │ │ │ └─    1.9 ms - platforms/scale8.h
    │ │ │   └─    0.8 ms - platforms/shared/scale8.h
    │ │ └─    1.6 ms - platforms/math8.h
    │ │   └─    1.2 ms - platforms/shared/math8.h
    │ └─    1.6 ms - fl/math/beat.h
    │   └─    0.9 ms - fl/math/trig8.h
    │     └─    0.9 ms - platforms/trig8.h
    │       └─    0.8 ms - platforms/shared/trig8.h
    └─    2.7 ms - crgb.hpp
fl/ui.h (102.5ms)
  ├─   64.7 ms - fl/stl/json.h
  │ └─   50.5 ms - fl/stl/json/types.h
  │   └─    6.2 ms - fl/stl/limits.h
  ├─    9.7 ms - fl/ui_impl.h
  │ └─    9.1 ms - platforms/ui_defs.h
  │   ├─    2.0 ms - platforms/shared/ui/json/audio.h
  │   │ └─    1.0 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.4 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    0.8 ms - platforms/shared/ui/json/checkbox.h
  │   ├─    0.8 ms - platforms/shared/ui/json/help.h
  │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  └─    4.9 ms - fl/stl/url.h
chipsets.h (24.3ms)
  ├─    9.9 ms - fl/chipsets/ucs7604.h
  │ └─    7.4 ms - fl/chipsets/encoders/ucs7604.h
  ├─    5.7 ms - fl/chipsets/apa102.h
  ├─    1.6 ms - fl/chipsets/lpd880x.h
  ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
  └─    0.7 ms - fl/chipsets/p9813.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1220.0 ms - Source: FastLED.h
  2.  1220.0 ms - Total Source: 
  3.   659.3 ms - Source: fl/task/executor.h
  4.   540.3 ms - Total ParseClass: 
  5.   357.5 ms - Source: fl/fastled.h
  6.   345.4 ms - Source: fl/task/promise.h
  7.   304.2 ms - Source: fl/stl/function.h
  8.   301.8 ms - Source: fl/task/scheduler.h
  9.   293.0 ms - Source: fl/stl/singleton.h
 10.   292.3 ms - Source: fl/stl/thread_local.h
 11.   291.2 ms - Source: fl/stl/thread.h
 12.   291.2 ms - Source: platforms/thread.h
 13.   291.1 ms - Source: platforms/stub/thread_stub.h
 14.   291.0 ms - Source: platforms/stub/thread_stub_stl.h
 15.   286.3 ms - Source: thread
 16.   192.0 ms - Source: crgb.h
 17.   190.8 ms - Source: fl/gfx/crgb.h
 18.   186.8 ms - Total InstantiateFunction: 
 19.   186.6 ms - Source: fl/math/ease.h
 20.   184.7 ms - Source: fl/math/fixed_point.h

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1220.0ms)
    - fl/task/executor.h (659.3ms)
    - fl/fastled.h (357.5ms)
    - fl/task/promise.h (345.4ms)
    - fl/stl/function.h (304.2ms)
    - fl/task/scheduler.h (301.8ms)
    - fl/stl/singleton.h (293.0ms)
    - fl/stl/thread_local.h (292.3ms)
    - fl/stl/thread.h (291.2ms)
    - platforms/thread.h (291.2ms)

⚠️  Template instantiation time is high (31.9% of total)
✓  Lexing time is acceptable (<10% of total)

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1220.0ms)
2. Consider optimizing fl/task/executor.h (659.3ms)
3. Consider optimizing fl/fastled.h (357.5ms)

================================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LCD_SPI driver: buffer growth path fails on ESP32-S3 hardware

1 participant