Skip to content

feat(audio/fft): ESP-DSP backend + AudioFftParity hardware validation harness - #2315

Merged
zackees merged 1 commit into
masterfrom
feat/audio-fft-parity-test
Apr 18, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/audio-fft-parity-test

Conversation

@zackees

@zackees zackees commented Apr 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Groundwork for audio-pipeline optimization in issue #2308 (#2254 Issue 3 follow-up). Lands the full ESP-DSP real-FFT implementation + a hardware sanity-test example that validates it on actual ESP32 silicon.

The harness worked as designed — it caught a real bug in the ESP-DSP unpack. Posting as-is with the dispatcher still defaulting to kiss_fftr so nothing ships broken.

What lands

src/fl/audio/fft/fft_backend.h

Full ESP-DSP real-FFT under detail::espDspRealForward(N, in, out):

  1. Pack N real samples as N/2 interleaved complex pairs.
  2. dsps_fft2r_fc32 + dsps_bit_rev_fc32_ansi (in-place complex FFT).
  3. Conjugate-symmetry unpack to N/2+1 kiss_fft_cpx bins using precomputed cos(2πk/N) / sin(2πk/N) tables (cached per-size in a static context).

Compiled only when FL_FFT_USE_ESP_DSP=1 AND ESP32. The top-level dispatcher fl_fft_real_forward() still routes through kiss_fftr regardless — see the inline comment for why: FastLED's default FASTLED_FFT_PRECISION=FASTLED_FFT_FIXED16 makes kiss_fft_scalar=int16_t which doesn't compose with ESP-DSP's float32 API. Auto-routing needs either an int16 packed-FFT variant using dsps_fft2r_sc16 or a library-wide switch to FASTLED_FFT_FLOAT. Tracked as follow-up.

Dispatcher API changed: takes explicit int N (kiss path casts to void; the ESP-DSP path needs it because kiss_fftr_cfg is opaque).

src/fl/audio/fft/fft_impl.cpp.hpp

7 call sites updated to pass size (mInputSamples, mHybridMidN*2, mHybridSmallN).

examples/AudioFftParity/AudioFftParity.ino (NEW)

Hardware sanity test. Generates 6 known signals and validates analytic properties of the ESP-DSP output:

Test Expected Actual on hardware (ESP32-S3)
zero all bins zero ✅ PASS (max mag < 1e-4)
dc bin 0 ≈ 0.7·N, others zero ❌ FAIL (bin 0 ≈ 178, others ≈ 179)
impulse flat magnitude ≈ 1.0 across all bins ❌ FAIL (min 125.9, max 179.5)
sine@bin40 peak at bin 40 ≥ 10× next ❌ FAIL (peak 187, maxOther 206)
sine@bin113 peak at bin 113 ≥ 10× next ❌ FAIL (peak 179, maxOther 179)
sine@bin200 peak at bin 200 ≥ 10× next ❌ FAIL (peak 186, maxOther 200)

Compiles on all platforms (non-ESP32 stub): empty setup/loop so the host example-tests CI stage doesn't break.

Use:

bash compile esp32s3 --examples AudioFftParity
bash debug AudioFftParity --expect FFT_PARITY_PASS --fail-on FFT_PARITY_FAIL

What this tells us

The pattern (~179 magnitude EVERYWHERE regardless of input) suggests the issue is either:

  1. Bit-reversal ordering after dsps_fft2r_fc32 is different from what my unpack expects.
  2. Twiddle-table indexing: ctx.cos_table[k-1] / sin_table[k-1] may not match what the formula expects for a given k.
  3. Packed-complex layout confusion: ctx.work[2*k, 2*k+1] may not be interpreted as Re, Im by dsps_fft2r_fc32 — could be [real-array, imag-array] convention.

Next step is debugging the ESP-DSP unpack by inspecting raw intermediate values from a known input. That's a focused follow-up — safer to ship this harness first (catches future regressions) and leave the dispatcher on the known-good kiss path.

Test plan

  • bash test fft — 1/1 pass. Kiss path unchanged.
  • bash test audio — 1/1 pass.
  • bash compile esp32s3 --examples AudioFftParity — succeeds.
  • Hardware on ESP32-S3: zero passes, others fail (see table above).
  • Follow-up: debug ESP-DSP unpack; expected to converge on PASS once fixed.

Related

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Added Arduino sketch with comprehensive FFT verification tests covering zero input, DC, impulse, and sine wave cases.
  • New Features

    • Introduced optional ESP-DSP backend support for FFT operations.
  • Refactor

    • Updated FFT function signature to include explicit FFT size parameter.

Adds the full ESP-DSP real-FFT backend as groundwork for audio
pipeline optimization (issue #2308 / #2254 Issue 3 follow-up) along
with a hardware validation sketch.

What's added:

  src/fl/audio/fft/fft_backend.h
    - Full ESP-DSP real-FFT implementation under `detail::espDspRealForward`,
      gated on FL_FFT_USE_ESP_DSP=1 + defined(FL_IS_ESP32).
    - Pattern: pack N reals as N/2 complex, run dsps_fft2r_fc32 + bit-rev,
      unpack conjugate-symmetric output to N/2+1 kiss_fft_cpx bins via
      precomputed cos/sin twiddle tables.
    - Updated wrapper signature: fl_fft_real_forward() now takes explicit
      `int N` so the ESP-DSP path can index its per-size twiddle cache
      (kiss_fftr_cfg is opaque).
    - Dispatcher still routes through kiss_fftr regardless of
      FL_FFT_ESP_DSP_ACTIVE — see inline comment for the int16/float
      type mismatch reason (FASTLED_FFT_FIXED16 default makes
      kiss_fft_scalar=int16_t which doesn't compose with ESP-DSP's fc32).

  src/fl/audio/fft/fft_impl.cpp.hpp
    - 7 call sites pass N (mInputSamples, mHybridMidN*2, mHybridSmallN).

  examples/AudioFftParity/AudioFftParity.ino  (new)
    - Hardware sanity test: generates known signals (zero, DC, impulse,
      sines at bins 40/113/200) and validates mathematical properties of
      ESP-DSP output (DC spike at bin 0 only, flat spectrum from impulse,
      peaks 10x above noise floor for single tones). Emits
      FFT_PARITY_PASS / FFT_PARITY_FAIL on serial.
    - Empty setup/loop on non-ESP32 so the host example-compile stage
      doesn't fail.

Current state on ESP32-S3 hardware:
  zero    PASS   (correct zero output)
  dc      FAIL   (output ~flat ~179 instead of DC spike)
  impulse FAIL   (output not uniform as expected)
  sines   FAIL

So: the ESP-DSP math has a subtle bug the sanity test is catching —
exactly the outcome the parity harness is meant to produce before
enabling the backend in production. Header comment flags this and
leaves the dispatcher on kiss_fftr. Follow-up work: debug the unpack
(suspect cos/sin twiddle indexing or bit-reversal ordering).

Test plan:
 * bash test fft  -> 1/1 pass  (kiss path unchanged)
 * bash test audio -> 1/1 pass
 * bash compile esp32s3 --examples AudioFftParity -> SUCCESS
 * bash debug AudioFftParity -> emits FFT_PARITY_FAIL (as expected
   currently; will flip to PASS after the math bug is fixed)

See issue #2308 for the broader audio-performance plan.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 18, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Adds a new FFT parity verification Arduino sketch and introduces ESP-DSP backend infrastructure with conditional compilation support in the FFT backend header. Updates the fl_fft_real_forward function signature to accept an explicit N parameter and modifies all call sites accordingly. The ESP-DSP implementation is available but not actively routed through the main dispatcher function.

Changes

Cohort / File(s) Summary
FFT Parity Test Sketch
examples/AudioFftParity/AudioFftParity.ino
New Arduino sketch for validating ESP-DSP FFT backend implementation through four test cases: zero input, DC input, impulse, and sine-tone validation with magnitude thresholds and bin dominance checks.
FFT Backend Infrastructure
src/fl/audio/fft/fft_backend.h
Introduces ESP-DSP backend support with conditional compilation gates, lazy global initialization, per-size cached twiddle/work allocation, and real FFT execution. Updates fl_fft_real_forward signature to include explicit N parameter; main dispatcher continues routing to Kiss FFT regardless of backend availability.
FFT Implementation Call Sites
src/fl/audio/fft/fft_impl.cpp.hpp
Updates all calls to fl_fft_real_forward to pass the new N parameter (mInputSamples and tier-specific lengths) across LOG_REBIN, CQ_NAIVE, CQ_OCTAVE, and CQ_HYBRID analysis paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • Issue #2308: Shares the same FFT backend codepath and ESP-DSP backend integration scope.

Possibly related PRs

  • PR #2310: Implements the dispatcher refactor and ESP-DSP backend that directly necessitates the N parameter signature change and related call-site updates across the FFT implementation.

Poem

🐰 Whiskers twitching with FFT delight,
ESP-DSP backends shining bright,
Parity checks in tests so fine—
Sine waves dancing, bin by bin! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main changes: adding an ESP-DSP backend implementation and a hardware validation harness (AudioFftParity) for FFT operations.

✏️ 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 feat/audio-fft-parity-test

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.

@zackees
zackees merged commit cf1d0f6 into master Apr 18, 2026
47 of 85 checks passed
@zackees zackees moved this to Triage in FastLED Tracker Apr 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 1174.67ms

Top 5 Slowest Headers

  1. FastLED.h - 897.44ms
  2. fl/fastled.h - 394.00ms
  3. fl/task/executor.h - 289.23ms
  4. crgb.h - 226.74ms
  5. fl/gfx/crgb.h - 225.45ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (897.4ms)
⚠️ Header fl/fastled.h exceeds 150ms (394.0ms)
⚠️ Header fl/task/executor.h exceeds 150ms (289.2ms)
⚠️ Header crgb.h exceeds 150ms (226.7ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (225.4ms)
⚠️ Header fl/math/ease.h exceeds 150ms (220.4ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (218.0ms)
⚠️ Header fl/task/scheduler.h exceeds 150ms (153.6ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (144.0ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (143.3ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (142.1ms)
⚠️ Header platforms/thread.h exceeds 50ms (142.0ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (142.0ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (142.0ms)
⚠️ Header fl/task/promise.h exceeds 50ms (122.0ms)
⚠️ Header fl/ui.h exceeds 50ms (119.3ms)
⚠️ Header fl/stl/json.h exceeds 50ms (76.8ms)
⚠️ Header fl/stl/function.h exceeds 50ms (72.4ms)
⚠️ Header fl/math/fixed_point/s4x12.h exceeds 50ms (62.6ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (59.5ms)
⚠️ Header platforms.h exceeds 50ms (54.7ms)
⚠️ Header platforms/stub/fastled_stub.h exceeds 50ms (54.7ms)
⚠️ Template instantiation time is high (52.5%)

Full Report
================================================================================
FASTLED COMPILATION PERFORMANCE REPORT
================================================================================
Generated: 2026-04-18 20:21:35
Compiler: clang++-17
File: ci/perf/test_compile.cpp

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    2,251.96 ms
Frontend Time:             17.38 ms (0.8%)
Backend Time:              369.13 ms (16.4%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    12266.00 ms (544.7%)
Templates                   611.89 ms ( 27.2%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1452.2 ms - FastLED.h (SLOW)
   713.1 ms - fl/task/executor.h (SLOW)
   508.7 ms - fl/fastled.h (SLOW)
   359.3 ms - fl/task/scheduler.h (SLOW)
   349.8 ms - fl/stl/singleton.h (SLOW)
   349.1 ms - fl/stl/thread_local.h (SLOW)
   348.0 ms - fl/stl/thread.h (SLOW)
   347.9 ms - platforms/thread.h (SLOW)
   347.8 ms - platforms/stub/thread_stub.h (SLOW)
   347.8 ms - platforms/stub/thread_stub_stl.h (SLOW)
   340.1 ms - fl/task/promise.h (SLOW)
   315.5 ms - crgb.h (SLOW)
   314.1 ms - fl/gfx/crgb.h (SLOW)
   309.2 ms - fl/math/ease.h (SLOW)
   306.7 ms - fl/math/fixed_point.h (SLOW)
   290.4 ms - fl/stl/function.h (SLOW)
   158.8 ms - fl/math/fixed_point/s4x12.h (SLOW)
   140.4 ms - fl/stl/vector.h (SLOW)
   138.0 ms - fl/math/sin32.h (SLOW)
   134.8 ms - fl/math/simd.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1452.2ms)
  ├─  713.1 ms - fl/task/executor.h
  │ ├─  359.3 ms - fl/task/scheduler.h
  │ │ ├─  349.8 ms - fl/stl/singleton.h
  │ │ │ └─  349.1 ms - fl/stl/thread_local.h
  │ │ │   └─  348.0 ms - fl/stl/thread.h
  │ │ │     └─  347.9 ms - platforms/thread.h
  │ │ │       └─  347.8 ms - platforms/stub/thread_stub.h
  │ │ │         └─  347.8 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  322.1 ms - thread
  │ │ │             ├─  173.3 ms - std_thread.h
  │ │ │             └─  132.3 ms - this_thread_sleep.h
  │ │ └─    8.7 ms - fl/task/task.h
  │ │   └─    3.5 ms - fl/trace.h
  │ │     ├─    2.2 ms - fl/stl/chrono.h
  │ │     └─    1.0 ms - fl/stl/tuple.h
  │ ├─  340.1 ms - fl/task/promise.h
  │ │ ├─  290.4 ms - fl/stl/function.h
  │ │ │ ├─  140.4 ms - fl/stl/vector.h
  │ │ │ │ ├─  105.9 ms - fl/math/math.h
  │ │ │ │ │ └─  100.0 ms - fl/stl/undef.h
  │ │ │ │ │   └─  178.8 ms - stdlib.h
  │ │ │ │ │     ├─   91.3 ms - cstdlib
  │ │ │ │ │     │ └─  178.8 ms - stdlib.h
  │ │ │ │ │     │   ├─   91.3 ms - cstdlib
  │ │ │ │ │     │   ├─   24.8 ms - types.h
  │ │ │ │ │     │   └─    0.6 ms - floatn.h
  │ │ │ │ │     ├─   24.8 ms - types.h
  │ │ │ │ │     │ ├─   24.8 ms - types.h
  │ │ │ │ │     │ │ ├─   24.8 ms - types.h
  │ │ │ │ │     │ │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │ │     │ │ ├─    1.6 ms - select.h
  │ │ │ │ │     │ │ └─    1.6 ms - endian.h
  │ │ │ │ │     │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │ │     │ │ └─    1.4 ms - thread-shared-types.h
  │ │ │ │ │     │ ├─    1.6 ms - select.h
  │ │ │ │ │     │ └─    1.6 ms - endian.h
  │ │ │ │ │     └─    0.6 ms - floatn.h
  │ │ │ │ ├─   18.9 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   12.9 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    8.3 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    2.2 ms - fl/stl/unique_ptr.h
  │ │ │ │ ├─    4.6 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.8 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.7 ms - fl/stl/functional.h
  │ │ │ ├─   68.6 ms - fl/stl/variant.h
  │ │ │ │ └─   66.7 ms - fl/stl/new.h
  │ │ │ │   └─   66.7 ms - platforms/new.h
  │ │ │ │     └─   66.7 ms - platforms/shared/new.h
  │ │ │ │       └─   57.8 ms - new
  │ │ │ │         ├─   39.6 ms - c++config.h
  │ │ │ │         │ └─   30.2 ms - os_defines.h
  │ │ │ │         └─    0.5 ms - version.h
  │ │ │ ├─   66.8 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   45.9 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   39.5 ms - fl/stl/move.h
  │ │ │ │ ├─   15.9 ms - fl/stl/atomic.h
  │ │ │ │ │ └─   15.0 ms - platforms/atomic.h
  │ │ │ │ │   └─   15.0 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.8 ms - fl/stl/bit_cast.h
  │ │ │ ├─    4.8 ms - fl/stl/algorithm.h
  │ │ │ │ └─    2.0 ms - fl/math/random.h
  │ │ │ │   └─    1.0 ms - fl/math/random8.h
  │ │ │ └─    4.1 ms - fl/stl/compiler_control.h
  │ │ └─   44.5 ms - fl/stl/string.h
  │ │   ├─   13.1 ms - fl/stl/basic_string.h
  │ │   │ ├─    1.1 ms - fl/stl/not_null.h
  │ │   │ ├─    0.9 ms - fl/stl/iterator.h
  │ │   │ └─    0.6 ms - fl/stl/charconv.h
  │ │   ├─    8.9 ms - fl/stl/span.h
  │ │   │ └─    3.5 ms - fl/math/geometry.h
  │ │   ├─    5.7 ms - fl/stl/string_view.h
  │ │   └─    1.5 ms - fl/stl/optional.h
  │ ├─   11.4 ms - platforms/await.h
  │ │ └─   11.0 ms - platforms/coroutine_runtime.h
  │ │   └─    9.4 ms - fl/system/engine_events.h
  │ │     ├─    4.9 ms - fl/math/screenmap.h
  │ │     │ └─    3.7 ms - fl/stl/flat_map.h
  │ │     └─    3.0 ms - fl/math/xymap.h
  │ │       └─    0.8 ms - fl/math/lut.h
  │ └─    0.8 ms - fl/task/promise_result.h
  ├─  508.7 ms - fl/fastled.h
  │ ├─  315.5 ms - crgb.h
  │ │ ├─  314.1 ms - fl/gfx/crgb.h
  │ │ │ └─  309.2 ms - fl/math/ease.h
  │ │ │   └─  306.7 ms - fl/math/fixed_point.h
  │ │ │     ├─  158.8 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─  138.0 ms - fl/math/sin32.h
  │ │ │     │ │ └─  134.8 ms - fl/math/simd.h
  │ │ │     │ │   └─  134.3 ms - fl/math/simd/types.h
  │ │ │     │ │     └─  134.0 ms - platforms/simd.h
  │ │ │     │ ├─    1.0 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.8 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   18.8 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   18.6 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   18.5 ms - fl/math/fixed_point/s16x16.h
  │ │ │     └─   18.4 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.9 ms - chsv.h
  │ │   └─    0.8 ms - fl/gfx/hsv.h
  │ ├─   82.0 ms - platforms.h
  │ │ └─   82.0 ms - platforms/stub/fastled_stub.h
  │ │   ├─   45.3 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   45.2 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   39.0 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   36.8 ms - fl/id_tracker.h
  │ │   │   │   └─   35.9 ms - fl/stl/mutex.h
  │ │   │   │     └─   35.8 ms - platforms/mutex.h
  │ │   │   │       └─   35.7 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.9 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   36.7 ms - platforms/stub/clockless_stub.h
  │ │     └─   36.6 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   13.1 ms - fl/system/log.h
  │ │       │ └─   12.6 ms - fl/stl/strstream.h
  │ │       ├─   13.0 ms - fl/channels/data.h
  │ │       │ └─    9.7 ms - fl/channels/config.h
  │ │       │   ├─    2.1 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.4 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.7 ms - fl/chipsets/spi.h
  │ │       ├─    2.3 ms - fl/channels/manager.h
  │ │       ├─    1.5 ms - fl/stl/weak_ptr.h
  │ │       └─    1.1 ms - fl/channels/driver.h
  │ ├─   43.1 ms - colorutils.h
  │ │ └─   42.2 ms - fl/gfx/colorutils.h
  │ │   ├─    9.0 ms - fl/gfx/blur.h
  │ │   │ └─    4.8 ms - fl/gfx/canvas.h
  │ │   │   └─    2.8 ms - fl/math/alpha.h
  │ │   └─    3.2 ms - fl/gfx/fill.h
  │ ├─   23.7 ms - pixel_controller.h
  │ │ ├─   17.1 ms - pixel_iterator.h
  │ │ │ └─   17.0 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    5.1 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    3.9 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    3.3 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    4.4 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    1.0 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.8 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.6 ms - rgbw.h
  │ │   └─    2.4 ms - fl/gfx/rgbw.h
  │ └─   22.6 ms - pixeltypes.h
  │   ├─   19.0 ms - lib8tion.h
  │   │ ├─   10.0 ms - fl/math/math8.h
  │   │ │ ├─    5.2 ms - fl/math/intmap.h
  │   │ │ │ └─    4.1 ms - platforms/intmap.h
  │   │ │ ├─    2.5 ms - fl/math/scale8.h
  │   │ │ │ └─    2.5 ms - platforms/scale8.h
  │   │ │ │   └─    1.0 ms - platforms/shared/scale8.h
  │   │ │ └─    2.1 ms - platforms/math8.h
  │   │ │   └─    1.7 ms - platforms/shared/math8.h
  │   │ ├─    2.0 ms - fl/math/beat.h
  │   │ │ └─    1.1 ms - fl/math/trig8.h
  │   │ │   └─    1.0 ms - platforms/trig8.h
  │   │ │     └─    0.9 ms - platforms/shared/trig8.h
  │   │ └─    0.5 ms - fl/math/qfx.h
  │   └─    3.2 ms - crgb.hpp
  ├─  121.9 ms - fl/ui.h
  │ ├─   78.3 ms - fl/stl/json.h
  │ │ └─   60.9 ms - fl/stl/json/types.h
  │ │   └─    7.6 ms - fl/stl/limits.h
  │ ├─   10.4 ms - fl/ui_impl.h
  │ │ └─    9.7 ms - platforms/ui_defs.h
  │ │   ├─    2.2 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    1.0 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.5 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/checkbox.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/help.h
  │ │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  │ └─    6.9 ms - fl/stl/url.h
  ├─   28.4 ms - chipsets.h
  │ ├─   11.6 ms - fl/chipsets/ucs7604.h
  │ │ └─    8.8 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    6.6 ms - fl/chipsets/apa102.h
  │ ├─    1.8 ms - fl/chipsets/lpd880x.h
  │ ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
  │ └─    0.8 ms - fl/chipsets/p9813.h
  └─   23.9 ms - fl/audio/audio_processor.h
    ├─    5.9 ms - fl/audio/audio_context.h
    │ └─    1.7 ms - fl/audio/fft/fft.h
    ├─    2.3 ms - fl/audio/detector/vibe.h
    └─    1.0 ms - fl/audio/signal_conditioner.h
fl/task/executor.h (713.1ms)
  ├─  359.3 ms - fl/task/scheduler.h
  │ ├─  349.8 ms - fl/stl/singleton.h
  │ │ └─  349.1 ms - fl/stl/thread_local.h
  │ │   └─  348.0 ms - fl/stl/thread.h
  │ │     └─  347.9 ms - platforms/thread.h
  │ │       └─  347.8 ms - platforms/stub/thread_stub.h
  │ │         └─  347.8 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  322.1 ms - thread
  │ │             ├─  173.3 ms - std_thread.h
  │ │             │ ├─   58.6 ms - tuple
  │ │             │ ├─   28.0 ms - iosfwd
  │ │             │ ├─   21.4 ms - refwrap.h
  │ │             │ ├─   15.2 ms - gthr.h
  │ │             │ └─    5.9 ms - unique_ptr.h
  │ │             └─  132.3 ms - this_thread_sleep.h
  │ │               ├─   98.2 ms - chrono.h
  │ │               └─   24.3 ms - cerrno
  │ └─    8.7 ms - fl/task/task.h
  │   └─    3.5 ms - fl/trace.h
  │     ├─    2.2 ms - fl/stl/chrono.h
  │     └─    1.0 ms - fl/stl/tuple.h
  ├─  340.1 ms - fl/task/promise.h
  │ ├─  290.4 ms - fl/stl/function.h
  │ │ ├─  140.4 ms - fl/stl/vector.h
  │ │ │ ├─  105.9 ms - fl/math/math.h
  │ │ │ │ └─  100.0 ms - fl/stl/undef.h
  │ │ │ │   └─  178.8 ms - stdlib.h
  │ │ │ │     ├─   91.3 ms - cstdlib
  │ │ │ │     │ └─  178.8 ms - stdlib.h
  │ │ │ │     │   ├─   91.3 ms - cstdlib
  │ │ │ │     │   │ └─  178.8 ms - stdlib.h
  │ │ │ │     │   ├─   24.8 ms - types.h
  │ │ │ │     │   │ ├─   24.8 ms - types.h
  │ │ │ │     │   │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │     │   │ ├─    1.6 ms - select.h
  │ │ │ │     │   │ └─    1.6 ms - endian.h
  │ │ │ │     │   └─    0.6 ms - floatn.h
  │ │ │ │     ├─   24.8 ms - types.h
  │ │ │ │     │ ├─   24.8 ms - types.h
  │ │ │ │     │ │ ├─   24.8 ms - types.h
  │ │ │ │     │ │ │ ├─   24.8 ms - types.h
  │ │ │ │     │ │ │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │     │ │ │ ├─    1.6 ms - select.h
  │ │ │ │     │ │ │ └─    1.6 ms - endian.h
  │ │ │ │     │ │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │     │ │ │ └─    1.4 ms - thread-shared-types.h
  │ │ │ │     │ │ ├─    1.6 ms - select.h
  │ │ │ │     │ │ └─    1.6 ms - endian.h
  │ │ │ │     │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │     │ │ └─    1.4 ms - thread-shared-types.h
  │ │ │ │     │ ├─    1.6 ms - select.h
  │ │ │ │     │ └─    1.6 ms - endian.h
  │ │ │ │     └─    0.6 ms - floatn.h
  │ │ │ ├─   18.9 ms - fl/stl/allocator.h
  │ │ │ │ └─   12.9 ms - fl/stl/bitset.h
  │ │ │ │   └─    8.3 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    2.2 ms - fl/stl/unique_ptr.h
  │ │ │ ├─    4.6 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.8 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.7 ms - fl/stl/functional.h
  │ │ ├─   68.6 ms - fl/stl/variant.h
  │ │ │ └─   66.7 ms - fl/stl/new.h
  │ │ │   └─   66.7 ms - platforms/new.h
  │ │ │     └─   66.7 ms - platforms/shared/new.h
  │ │ │       └─   57.8 ms - new
  │ │ │         ├─   39.6 ms - c++config.h
  │ │ │         │ └─   30.2 ms - os_defines.h
  │ │ │         │   └─   25.8 ms - features.h
  │ │ │         └─    0.5 ms - version.h
  │ │ ├─   66.8 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   45.9 ms - fl/stl/type_traits.h
  │ │ │ │ └─   39.5 ms - fl/stl/move.h
  │ │ │ ├─   15.9 ms - fl/stl/atomic.h
  │ │ │ │ └─   15.0 ms - platforms/atomic.h
  │ │ │ │   └─   15.0 ms - platforms/shared/atomic.h
  │ │ │ └─    0.8 ms - fl/stl/bit_cast.h
  │ │ ├─    4.8 ms - fl/stl/algorithm.h
  │ │ │ └─    2.0 ms - fl/math/random.h
  │ │ │   └─    1.0 ms - fl/math/random8.h
  │ │ └─    4.1 ms - fl/stl/compiler_control.h
  │ └─   44.5 ms - fl/stl/string.h
  │   ├─   13.1 ms - fl/stl/basic_string.h
  │   │ ├─    1.1 ms - fl/stl/not_null.h
  │   │ ├─    0.9 ms - fl/stl/iterator.h
  │   │ └─    0.6 ms - fl/stl/charconv.h
  │   ├─    8.9 ms - fl/stl/span.h
  │   │ └─    3.5 ms - fl/math/geometry.h
  │   ├─    5.7 ms - fl/stl/string_view.h
  │   └─    1.5 ms - fl/stl/optional.h
  ├─   11.4 ms - platforms/await.h
  │ └─   11.0 ms - platforms/coroutine_runtime.h
  │   └─    9.4 ms - fl/system/engine_events.h
  │     ├─    4.9 ms - fl/math/screenmap.h
  │     │ └─    3.7 ms - fl/stl/flat_map.h
  │     └─    3.0 ms - fl/math/xymap.h
  │       └─    0.8 ms - fl/math/lut.h
  └─    0.8 ms - fl/task/promise_result.h
fl/fastled.h (508.7ms)
  ├─  315.5 ms - crgb.h
  │ ├─  314.1 ms - fl/gfx/crgb.h
  │ │ └─  309.2 ms - fl/math/ease.h
  │ │   └─  306.7 ms - fl/math/fixed_point.h
  │ │     ├─  158.8 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─  138.0 ms - fl/math/sin32.h
  │ │     │ │ └─  134.8 ms - fl/math/simd.h
  │ │     │ │   └─  134.3 ms - fl/math/simd/types.h
  │ │     │ │     └─  134.0 ms - platforms/simd.h
  │ │     │ │       └─  134.0 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    1.0 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.8 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   18.8 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   18.6 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   18.5 ms - fl/math/fixed_point/s16x16.h
  │ │     └─   18.4 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.9 ms - chsv.h
  │   └─    0.8 ms - fl/gfx/hsv.h
  ├─   82.0 ms - platforms.h
  │ └─   82.0 ms - platforms/stub/fastled_stub.h
  │   ├─   45.3 ms - platforms/stub/fastspi_stub.h
  │   │ └─   45.2 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   39.0 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   36.8 ms - fl/id_tracker.h
  │   │   │   └─   35.9 ms - fl/stl/mutex.h
  │   │   │     └─   35.8 ms - platforms/mutex.h
  │   │   │       └─   35.7 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   35.6 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.9 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   36.7 ms - platforms/stub/clockless_stub.h
  │     └─   36.6 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   13.1 ms - fl/system/log.h
  │       │ └─   12.6 ms - fl/stl/strstream.h
  │       ├─   13.0 ms - fl/channels/data.h
  │       │ └─    9.7 ms - fl/channels/config.h
  │       │   ├─    2.1 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.4 ms - fl/chipsets/led_timing.h
  │       │   └─    1.7 ms - fl/chipsets/spi.h
  │       ├─    2.3 ms - fl/channels/manager.h
  │       ├─    1.5 ms - fl/stl/weak_ptr.h
  │       └─    1.1 ms - fl/channels/driver.h
  ├─   43.1 ms - colorutils.h
  │ └─   42.2 ms - fl/gfx/colorutils.h
  │   ├─    9.0 ms - fl/gfx/blur.h
  │   │ └─    4.8 ms - fl/gfx/canvas.h
  │   │   └─    2.8 ms - fl/math/alpha.h
  │   └─    3.2 ms - fl/gfx/fill.h
  ├─   23.7 ms - pixel_controller.h
  │ ├─   17.1 ms - pixel_iterator.h
  │ │ └─   17.0 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    5.1 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    3.9 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    3.3 ms - fl/gfx/gamma_lut.h
  │ │   ├─    4.4 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    1.0 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.8 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.6 ms - rgbw.h
  │   └─    2.4 ms - fl/gfx/rgbw.h
  └─   22.6 ms - pixeltypes.h
    ├─   19.0 ms - lib8tion.h
    │ ├─   10.0 ms - fl/math/math8.h
    │ │ ├─    5.2 ms - fl/math/intmap.h
    │ │ │ └─    4.1 ms - platforms/intmap.h
    │ │ ├─    2.5 ms - fl/math/scale8.h
    │ │ │ └─    2.5 ms - platforms/scale8.h
    │ │ │   └─    1.0 ms - platforms/shared/scale8.h
    │ │ └─    2.1 ms - platforms/math8.h
    │ │   └─    1.7 ms - platforms/shared/math8.h
    │ ├─    2.0 ms - fl/math/beat.h
    │ │ └─    1.1 ms - fl/math/trig8.h
    │ │   └─    1.0 ms - platforms/trig8.h
    │ │     └─    0.9 ms - platforms/shared/trig8.h
    │ └─    0.5 ms - fl/math/qfx.h
    └─    3.2 ms - crgb.hpp
fl/ui.h (121.9ms)
  ├─   78.3 ms - fl/stl/json.h
  │ └─   60.9 ms - fl/stl/json/types.h
  │   └─    7.6 ms - fl/stl/limits.h
  ├─   10.4 ms - fl/ui_impl.h
  │ └─    9.7 ms - platforms/ui_defs.h
  │   ├─    2.2 ms - platforms/shared/ui/json/audio.h
  │   │ └─    1.0 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.5 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    0.9 ms - platforms/shared/ui/json/checkbox.h
  │   ├─    0.9 ms - platforms/shared/ui/json/help.h
  │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  └─    6.9 ms - fl/stl/url.h
chipsets.h (28.4ms)
  ├─   11.6 ms - fl/chipsets/ucs7604.h
  │ └─    8.8 ms - fl/chipsets/encoders/ucs7604.h
  ├─    6.6 ms - fl/chipsets/apa102.h
  ├─    1.8 ms - fl/chipsets/lpd880x.h
  ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
  └─    0.8 ms - fl/chipsets/p9813.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1452.2 ms - Source: FastLED.h
  2.  1452.2 ms - Total Source: 
  3.   713.1 ms - Source: fl/task/executor.h
  4.   659.0 ms - Total ParseClass: 
  5.   508.7 ms - Source: fl/fastled.h
  6.   359.3 ms - Source: fl/task/scheduler.h
  7.   349.8 ms - Source: fl/stl/singleton.h
  8.   349.1 ms - Source: fl/stl/thread_local.h
  9.   348.0 ms - Source: fl/stl/thread.h
 10.   347.9 ms - Source: platforms/thread.h
 11.   347.8 ms - Source: platforms/stub/thread_stub.h
 12.   347.8 ms - Source: platforms/stub/thread_stub_stl.h
 13.   340.1 ms - Source: fl/task/promise.h
 14.   322.1 ms - Source: thread
 15.   315.5 ms - Source: crgb.h
 16.   314.1 ms - Source: fl/gfx/crgb.h
 17.   309.2 ms - Source: fl/math/ease.h
 18.   306.7 ms - Source: fl/math/fixed_point.h
 19.   290.4 ms - Source: fl/stl/function.h
 20.   218.7 ms - Total InstantiateFunction: 

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1452.2ms)
    - fl/task/executor.h (713.1ms)
    - fl/fastled.h (508.7ms)
    - fl/task/scheduler.h (359.3ms)
    - fl/stl/singleton.h (349.8ms)
    - fl/stl/thread_local.h (349.1ms)
    - fl/stl/thread.h (348.0ms)
    - platforms/thread.h (347.9ms)
    - platforms/stub/thread_stub.h (347.8ms)
    - platforms/stub/thread_stub_stl.h (347.8ms)

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

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1452.2ms)
2. Consider optimizing fl/task/executor.h (713.1ms)
3. Consider optimizing fl/fastled.h (508.7ms)

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

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

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant