Skip to content

feat(audio): TempoAnalyzer confidence fades in silence (#2253) - #2311

Merged
zackees merged 1 commit into
masterfrom
feat/audio-silence-gate-tempo
Apr 18, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/audio-silence-gate-tempo

Conversation

@zackees

@zackees zackees commented Apr 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Gates TempoAnalyzer::mConfidence through a SilenceEnvelope (tau=2.0s, target=0) so rhythmic-effect confidence decays smoothly during silence instead of clinging to stale onset hypotheses for 5–10+ seconds.
  • Leaves the raw BPM estimate untouched — when audio returns, beat sync resumes from the same tempo with zero attack lag. Only the "should I drive rhythmic effects right now?" signal fades.
  • dt comes from context timestamp deltas so the first-order decay is frame-rate independent. !isSilent is a strict pass-through, preserving behavior for users who haven't opted into NoiseFloorTracker.

Part 4/4 of #2253 silence-gate rollout. Builds on #2306 (Phase 1 foundations).

Design notes

  • Tau = 2.0s: musical tempo has natural persistence. 0.5s tau (Vibe-style) felt twitchy for BPM; 2s matches listener intuition while still clearing within ~6s of silence.
  • Confidence, not BPM, is gated. The design doc rationale: preserving BPM means a tempo-locked effect can pick up exactly where it left off when music restarts, without a re-learning delay. The confidence gate prevents the effect from firing while the tempo is "live" but not actually audible.
  • No new public API surface. The envelope is a private member; existing getConfidence() / getBPM() / callback semantics are unchanged.

Test plan

  • bash test fl_audio --debug passes (211/211 doctest cases).
  • bash lint src/fl/audio/detector/tempo_analyzer.{h,cpp.hpp} tests/fl/audio/detector/tempo_analyzer.hpp clean.
  • New test TempoAnalyzer - confidence fades in silence, BPM preserved:
    • Drive 15 beats of synthetic 120 BPM onsets → assert confidence > 0.3, BPM in [90, 150].
    • Switch to context->setSilent(true) for ~5s → assert confidence < 0.05 AND BPM == pre-silence value.
  • New test TempoAnalyzer - confidence pass-through when not silent covers the audio-path no-op.
  • All 7 existing TempoAnalyzer tests still pass (no regression).

Scope-limited to tempo_analyzer; parallel agents are handling Vibe (PR-C) and Reactive spectral (PR-D).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced tempo detection to gracefully handle silent periods by decaying confidence levels while maintaining accurate BPM estimates, ensuring seamless resumption of reliable tempo tracking when audio resumes
  • Tests

    • Added unit tests validating proper confidence behavior during detected silence and confidence stability during active audio periods

Composes a fl::audio::SilenceEnvelope (tau=2.0s, target=0) into
TempoAnalyzer so that the BPM confidence metric decays smoothly during
silence instead of persisting on stale hypotheses. The raw BPM estimate
itself is NOT gated — last-known tempo is preserved across silence so
beat sync resumes seamlessly when audio returns. Tau=2s matches the
natural persistence of musical tempo; snapping faster feels wrong.

dt is derived from context timestamp deltas so the envelope's first-order
response is frame-rate independent. When context->isSilent() is false the
envelope is a strict pass-through, preserving existing tempo-detection
behavior for users who haven't enabled NoiseFloorTracker.

Adds two integration tests: one drives 15 beats of synthetic 120 BPM
onsets and confirms confidence > 0.3, then asserts confidence < 0.05
after ~5s of silence while BPM is unchanged; the other verifies
pass-through when isSilent=false.

User-visible impact: LED effects keyed to BPM confidence (rhythmic-effect
gating) stop driving rhythm when music stops, instead of staying "in
rhythm" for 5-10+ seconds on stale onset hypotheses.

Part 4/4 of #2253 silence-gate rollout. Builds on #2306.

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

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3844880c-3ba7-4983-82c8-713e51836813

📥 Commits

Reviewing files that changed from the base of the PR and between ed3b452 and 5d42749.

📒 Files selected for processing (3)
  • src/fl/audio/detector/tempo_analyzer.cpp.hpp
  • src/fl/audio/detector/tempo_analyzer.h
  • tests/fl/audio/detector/tempo_analyzer.hpp

📝 Walkthrough

Walkthrough

The TempoAnalyzer class now gates its confidence output based on detected silence. A new SilenceEnvelope member decays confidence toward zero when audio is silent, while internal timestamp tracking computes frame delta times. The BPM estimation logic remains unchanged, allowing tempo to resume when silence ends.

Changes

Cohort / File(s) Summary
Silence Envelope Configuration
src/fl/audio/detector/tempo_analyzer.h
Added SilenceEnvelope mConfidenceEnvelope and timestamp-tracking members (mPrevTimestamp, mHasPrevTimestamp) to support per-frame delta time computation for confidence decay during silence.
Silence-Gated Confidence Logic
src/fl/audio/detector/tempo_analyzer.cpp.hpp
Implemented envelope initialization with 2.0-second decay tau in constructor, frame delta time calculation from successive timestamps in update(), silence state reading via context->isSilent(), and envelope reset logic in reset() method.
Silence Confidence Tests
tests/fl/audio/detector/tempo_analyzer.hpp
Added two unit tests validating that confidence decays below 0.05 during ~5 seconds of silence while BPM remains stable, and that confidence stays non-zero when silence is not active.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 When silence creeps across the beat,
Our confidence must gently retreat,
With two-second decay so smooth and slow,
We fade the doubts and let trust go,
Till sound returns and faith's renewed! 🎵

✨ 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-silence-gate-tempo

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 125c7cc into master Apr 18, 2026
62 of 85 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 1000.08ms

Top 5 Slowest Headers

  1. FastLED.h - 761.32ms
  2. fl/fastled.h - 315.61ms
  3. fl/task/executor.h - 249.08ms
  4. crgb.h - 173.94ms
  5. fl/gfx/crgb.h - 172.67ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (761.3ms)
⚠️ Header fl/fastled.h exceeds 150ms (315.6ms)
⚠️ Header fl/task/executor.h exceeds 150ms (249.1ms)
⚠️ Header crgb.h exceeds 150ms (173.9ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (172.7ms)
⚠️ Header fl/math/ease.h exceeds 150ms (168.4ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (166.5ms)
⚠️ Header fl/task/scheduler.h exceeds 50ms (127.6ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (118.5ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (117.9ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (116.8ms)
⚠️ Header platforms/thread.h exceeds 50ms (116.7ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (116.7ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (116.6ms)
⚠️ Header fl/ui.h exceeds 50ms (113.6ms)
⚠️ Header fl/task/promise.h exceeds 50ms (109.5ms)
⚠️ Header fl/stl/function.h exceeds 50ms (66.4ms)
⚠️ Header fl/stl/json.h exceeds 50ms (64.8ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (50.6ms)
⚠️ Template instantiation time is high (50.9%)

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

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    1,983.09 ms
Frontend Time:             14.66 ms (0.7%)
Backend Time:              229.99 ms (11.6%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    11753.75 ms (592.7%)
Templates                   511.25 ms ( 25.8%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1384.4 ms - FastLED.h (SLOW)
   684.2 ms - fl/task/executor.h (SLOW)
   473.4 ms - fl/fastled.h (SLOW)
   395.7 ms - fl/task/scheduler.h (SLOW)
   386.9 ms - fl/stl/singleton.h (SLOW)
   386.2 ms - fl/stl/thread_local.h (SLOW)
   385.1 ms - fl/stl/thread.h (SLOW)
   385.0 ms - platforms/thread.h (SLOW)
   385.0 ms - platforms/stub/thread_stub.h (SLOW)
   384.9 ms - platforms/stub/thread_stub_stl.h (SLOW)
   276.3 ms - fl/task/promise.h (SLOW)
   252.5 ms - crgb.h (SLOW)
   251.2 ms - fl/gfx/crgb.h (SLOW)
   247.0 ms - fl/math/ease.h (SLOW)
   245.1 ms - fl/math/fixed_point.h (SLOW)
   234.2 ms - fl/stl/function.h (SLOW)
   128.0 ms - platforms.h (SLOW)
   128.0 ms - platforms/stub/fastled_stub.h (SLOW)
   124.1 ms - fl/math/fixed_point/s4x12.h (SLOW)
   108.5 ms - fl/stl/shared_ptr.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1384.4ms)
  ├─  684.2 ms - fl/task/executor.h
  │ ├─  395.7 ms - fl/task/scheduler.h
  │ │ ├─  386.9 ms - fl/stl/singleton.h
  │ │ │ └─  386.2 ms - fl/stl/thread_local.h
  │ │ │   └─  385.1 ms - fl/stl/thread.h
  │ │ │     └─  385.0 ms - platforms/thread.h
  │ │ │       └─  385.0 ms - platforms/stub/thread_stub.h
  │ │ │         └─  384.9 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  379.5 ms - thread
  │ │ │             ├─  251.3 ms - std_thread.h
  │ │ │             └─  111.5 ms - this_thread_sleep.h
  │ │ └─    7.9 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
  │ ├─  276.3 ms - fl/task/promise.h
  │ │ ├─  234.2 ms - fl/stl/function.h
  │ │ │ ├─  108.5 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   79.9 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   74.7 ms - fl/stl/move.h
  │ │ │ │ ├─   24.2 ms - fl/stl/atomic.h
  │ │ │ │ │ └─   23.3 ms - platforms/atomic.h
  │ │ │ │ │   └─   23.3 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ │ ├─   69.3 ms - fl/stl/vector.h
  │ │ │ │ ├─   40.2 ms - fl/math/math.h
  │ │ │ │ │ └─   35.8 ms - fl/stl/undef.h
  │ │ │ │ │   └─   52.1 ms - stdlib.h
  │ │ │ │ │     ├─   26.3 ms - cstdlib
  │ │ │ │ │     │ └─   52.1 ms - stdlib.h
  │ │ │ │ │     │   ├─   26.3 ms - cstdlib
  │ │ │ │ │     │   └─   10.2 ms - types.h
  │ │ │ │ │     └─   10.2 ms - types.h
  │ │ │ │ │       ├─   10.2 ms - types.h
  │ │ │ │ │       │ ├─   10.2 ms - types.h
  │ │ │ │ │       │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │ │       │ ├─    1.8 ms - endian.h
  │ │ │ │ │       │ └─    1.8 ms - select.h
  │ │ │ │ │       ├─    1.9 ms - pthreadtypes.h
  │ │ │ │ │       │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │ │       ├─    1.8 ms - endian.h
  │ │ │ │ │       └─    1.8 ms - select.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
  │ │ │ │ ├─    4.7 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.3 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ │ ├─   42.4 ms - fl/stl/variant.h
  │ │ │ │ └─   40.8 ms - fl/stl/new.h
  │ │ │ │   └─   40.8 ms - platforms/new.h
  │ │ │ │     └─   40.8 ms - platforms/shared/new.h
  │ │ │ │       └─   30.8 ms - new
  │ │ │ │         ├─   14.6 ms - c++config.h
  │ │ │ │         │ └─    4.8 ms - os_defines.h
  │ │ │ │         └─    0.5 ms - version.h
  │ │ │ ├─    5.5 ms - fl/stl/compiler_control.h
  │ │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │ │   └─    1.6 ms - fl/math/random.h
  │ │ │     └─    0.7 ms - fl/math/random8.h
  │ │ └─   37.4 ms - fl/stl/string.h
  │ │   ├─   11.1 ms - fl/stl/basic_string.h
  │ │   │ ├─    0.9 ms - fl/stl/not_null.h
  │ │   │ └─    0.8 ms - fl/stl/iterator.h
  │ │   ├─    7.2 ms - fl/stl/span.h
  │ │   │ └─    3.0 ms - fl/math/geometry.h
  │ │   ├─    4.4 ms - fl/stl/string_view.h
  │ │   └─    1.3 ms - fl/stl/optional.h
  │ ├─   10.1 ms - platforms/await.h
  │ │ └─    9.8 ms - platforms/coroutine_runtime.h
  │ │   └─    8.2 ms - fl/system/engine_events.h
  │ │     ├─    4.1 ms - fl/math/screenmap.h
  │ │     │ └─    3.0 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
  ├─  473.4 ms - fl/fastled.h
  │ ├─  252.5 ms - crgb.h
  │ │ ├─  251.2 ms - fl/gfx/crgb.h
  │ │ │ └─  247.0 ms - fl/math/ease.h
  │ │ │   └─  245.1 ms - fl/math/fixed_point.h
  │ │ │     ├─  124.1 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─  107.1 ms - fl/math/sin32.h
  │ │ │     │ │ └─  104.5 ms - fl/math/simd.h
  │ │ │     │ │   └─  104.0 ms - fl/math/simd/types.h
  │ │ │     │ │     └─  103.7 ms - platforms/simd.h
  │ │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.6 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   15.2 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   15.1 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   14.7 ms - fl/math/fixed_point/s16x16.h
  │ │ │     └─   14.6 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.9 ms - chsv.h
  │ │   └─    0.8 ms - fl/gfx/hsv.h
  │ ├─  128.0 ms - platforms.h
  │ │ └─  128.0 ms - platforms/stub/fastled_stub.h
  │ │   ├─   95.0 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   95.0 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   89.1 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   87.1 ms - fl/id_tracker.h
  │ │   │   │   └─   86.1 ms - fl/stl/mutex.h
  │ │   │   │     └─   86.0 ms - platforms/mutex.h
  │ │   │   │       └─   85.9 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.5 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   32.9 ms - platforms/stub/clockless_stub.h
  │ │     └─   32.8 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   11.8 ms - fl/channels/data.h
  │ │       │ └─    8.7 ms - fl/channels/config.h
  │ │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.4 ms - fl/chipsets/spi.h
  │ │       ├─   11.1 ms - fl/system/log.h
  │ │       │ └─   10.7 ms - fl/stl/strstream.h
  │ │       ├─    2.3 ms - fl/channels/manager.h
  │ │       ├─    1.4 ms - fl/stl/weak_ptr.h
  │ │       └─    1.1 ms - fl/channels/driver.h
  │ ├─   35.1 ms - colorutils.h
  │ │ └─   34.3 ms - fl/gfx/colorutils.h
  │ │   ├─    7.5 ms - fl/gfx/blur.h
  │ │   │ └─    4.1 ms - fl/gfx/canvas.h
  │ │   │   └─    2.4 ms - fl/math/alpha.h
  │ │   └─    2.8 ms - fl/gfx/fill.h
  │ ├─   20.2 ms - pixel_controller.h
  │ │ ├─   14.4 ms - pixel_iterator.h
  │ │ │ └─   14.3 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    4.0 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    3.1 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.4 ms - rgbw.h
  │ │   └─    2.2 ms - fl/gfx/rgbw.h
  │ └─   18.2 ms - pixeltypes.h
  │   ├─   15.1 ms - lib8tion.h
  │   │ ├─    7.6 ms - fl/math/math8.h
  │   │ │ ├─    3.9 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.5 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
  ├─  104.5 ms - fl/ui.h
  │ ├─   66.0 ms - fl/stl/json.h
  │ │ └─   51.6 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
  │ │   │ └─    0.9 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.9 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
  │ └─    5.7 ms - fl/stl/url.h
  ├─   31.7 ms - fl/stl/stdint.h
  │ └─   31.4 ms - platforms/int.h
  │   └─   31.1 ms - platforms/shared/int.h
  │     └─   31.0 ms - platforms/shared/int_linux.h
  └─   24.7 ms - chipsets.h
    ├─   10.0 ms - fl/chipsets/ucs7604.h
    │ └─    7.5 ms - fl/chipsets/encoders/ucs7604.h
    ├─    5.8 ms - fl/chipsets/apa102.h
    ├─    1.5 ms - fl/chipsets/lpd880x.h
    ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
    └─    0.7 ms - fl/chipsets/p9813.h
fl/task/executor.h (684.2ms)
  ├─  395.7 ms - fl/task/scheduler.h
  │ ├─  386.9 ms - fl/stl/singleton.h
  │ │ └─  386.2 ms - fl/stl/thread_local.h
  │ │   └─  385.1 ms - fl/stl/thread.h
  │ │     └─  385.0 ms - platforms/thread.h
  │ │       └─  385.0 ms - platforms/stub/thread_stub.h
  │ │         └─  384.9 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  379.5 ms - thread
  │ │             ├─  251.3 ms - std_thread.h
  │ │             │ ├─   52.5 ms - tuple
  │ │             │ ├─   36.8 ms - refwrap.h
  │ │             │ ├─   30.0 ms - iosfwd
  │ │             │ ├─    9.5 ms - gthr.h
  │ │             │ └─    5.8 ms - unique_ptr.h
  │ │             └─  111.5 ms - this_thread_sleep.h
  │ │               ├─   93.3 ms - chrono.h
  │ │               └─    3.4 ms - cerrno
  │ └─    7.9 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
  ├─  276.3 ms - fl/task/promise.h
  │ ├─  234.2 ms - fl/stl/function.h
  │ │ ├─  108.5 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   79.9 ms - fl/stl/type_traits.h
  │ │ │ │ └─   74.7 ms - fl/stl/move.h
  │ │ │ ├─   24.2 ms - fl/stl/atomic.h
  │ │ │ │ └─   23.3 ms - platforms/atomic.h
  │ │ │ │   └─   23.3 ms - platforms/shared/atomic.h
  │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ ├─   69.3 ms - fl/stl/vector.h
  │ │ │ ├─   40.2 ms - fl/math/math.h
  │ │ │ │ └─   35.8 ms - fl/stl/undef.h
  │ │ │ │   └─   52.1 ms - stdlib.h
  │ │ │ │     ├─   26.3 ms - cstdlib
  │ │ │ │     │ └─   52.1 ms - stdlib.h
  │ │ │ │     │   ├─   26.3 ms - cstdlib
  │ │ │ │     │   │ └─   52.1 ms - stdlib.h
  │ │ │ │     │   └─   10.2 ms - types.h
  │ │ │ │     │     ├─   10.2 ms - types.h
  │ │ │ │     │     ├─    1.9 ms - pthreadtypes.h
  │ │ │ │     │     ├─    1.8 ms - endian.h
  │ │ │ │     │     └─    1.8 ms - select.h
  │ │ │ │     └─   10.2 ms - types.h
  │ │ │ │       ├─   10.2 ms - types.h
  │ │ │ │       │ ├─   10.2 ms - types.h
  │ │ │ │       │ │ ├─   10.2 ms - types.h
  │ │ │ │       │ │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │       │ │ ├─    1.8 ms - endian.h
  │ │ │ │       │ │ └─    1.8 ms - select.h
  │ │ │ │       │ ├─    1.9 ms - pthreadtypes.h
  │ │ │ │       │ │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │       │ ├─    1.8 ms - endian.h
  │ │ │ │       │ └─    1.8 ms - select.h
  │ │ │ │       ├─    1.9 ms - pthreadtypes.h
  │ │ │ │       │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │       ├─    1.8 ms - endian.h
  │ │ │ │       └─    1.8 ms - select.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
  │ │ │ ├─    4.7 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.3 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ ├─   42.4 ms - fl/stl/variant.h
  │ │ │ └─   40.8 ms - fl/stl/new.h
  │ │ │   └─   40.8 ms - platforms/new.h
  │ │ │     └─   40.8 ms - platforms/shared/new.h
  │ │ │       └─   30.8 ms - new
  │ │ │         ├─   14.6 ms - c++config.h
  │ │ │         │ └─    4.8 ms - os_defines.h
  │ │ │         │   └─    4.4 ms - features.h
  │ │ │         └─    0.5 ms - version.h
  │ │ ├─    5.5 ms - fl/stl/compiler_control.h
  │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │   └─    1.6 ms - fl/math/random.h
  │ │     └─    0.7 ms - fl/math/random8.h
  │ └─   37.4 ms - fl/stl/string.h
  │   ├─   11.1 ms - fl/stl/basic_string.h
  │   │ ├─    0.9 ms - fl/stl/not_null.h
  │   │ └─    0.8 ms - fl/stl/iterator.h
  │   ├─    7.2 ms - fl/stl/span.h
  │   │ └─    3.0 ms - fl/math/geometry.h
  │   ├─    4.4 ms - fl/stl/string_view.h
  │   └─    1.3 ms - fl/stl/optional.h
  ├─   10.1 ms - platforms/await.h
  │ └─    9.8 ms - platforms/coroutine_runtime.h
  │   └─    8.2 ms - fl/system/engine_events.h
  │     ├─    4.1 ms - fl/math/screenmap.h
  │     │ └─    3.0 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 (473.4ms)
  ├─  252.5 ms - crgb.h
  │ ├─  251.2 ms - fl/gfx/crgb.h
  │ │ └─  247.0 ms - fl/math/ease.h
  │ │   └─  245.1 ms - fl/math/fixed_point.h
  │ │     ├─  124.1 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─  107.1 ms - fl/math/sin32.h
  │ │     │ │ └─  104.5 ms - fl/math/simd.h
  │ │     │ │   └─  104.0 ms - fl/math/simd/types.h
  │ │     │ │     └─  103.7 ms - platforms/simd.h
  │ │     │ │       └─  103.6 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.6 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   15.2 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   15.1 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   14.7 ms - fl/math/fixed_point/s16x16.h
  │ │     └─   14.6 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.9 ms - chsv.h
  │   └─    0.8 ms - fl/gfx/hsv.h
  ├─  128.0 ms - platforms.h
  │ └─  128.0 ms - platforms/stub/fastled_stub.h
  │   ├─   95.0 ms - platforms/stub/fastspi_stub.h
  │   │ └─   95.0 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   89.1 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   87.1 ms - fl/id_tracker.h
  │   │   │   └─   86.1 ms - fl/stl/mutex.h
  │   │   │     └─   86.0 ms - platforms/mutex.h
  │   │   │       └─   85.9 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   85.8 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.5 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   32.9 ms - platforms/stub/clockless_stub.h
  │     └─   32.8 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   11.8 ms - fl/channels/data.h
  │       │ └─    8.7 ms - fl/channels/config.h
  │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │       │   └─    1.4 ms - fl/chipsets/spi.h
  │       ├─   11.1 ms - fl/system/log.h
  │       │ └─   10.7 ms - fl/stl/strstream.h
  │       ├─    2.3 ms - fl/channels/manager.h
  │       ├─    1.4 ms - fl/stl/weak_ptr.h
  │       └─    1.1 ms - fl/channels/driver.h
  ├─   35.1 ms - colorutils.h
  │ └─   34.3 ms - fl/gfx/colorutils.h
  │   ├─    7.5 ms - fl/gfx/blur.h
  │   │ └─    4.1 ms - fl/gfx/canvas.h
  │   │   └─    2.4 ms - fl/math/alpha.h
  │   └─    2.8 ms - fl/gfx/fill.h
  ├─   20.2 ms - pixel_controller.h
  │ ├─   14.4 ms - pixel_iterator.h
  │ │ └─   14.3 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    4.0 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    3.1 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.4 ms - rgbw.h
  │   └─    2.2 ms - fl/gfx/rgbw.h
  └─   18.2 ms - pixeltypes.h
    ├─   15.1 ms - lib8tion.h
    │ ├─    7.6 ms - fl/math/math8.h
    │ │ ├─    3.9 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.5 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 (104.5ms)
  ├─   66.0 ms - fl/stl/json.h
  │ └─   51.6 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
  │   │ └─    0.9 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.9 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
  └─    5.7 ms - fl/stl/url.h
fl/stl/stdint.h (31.7ms)
  └─   31.4 ms - platforms/int.h
    └─   31.1 ms - platforms/shared/int.h
      └─   31.0 ms - platforms/shared/int_linux.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1384.4 ms - Source: FastLED.h
  2.  1384.4 ms - Total Source: 
  3.   684.2 ms - Source: fl/task/executor.h
  4.   568.2 ms - Total ParseClass: 
  5.   473.4 ms - Source: fl/fastled.h
  6.   395.7 ms - Source: fl/task/scheduler.h
  7.   386.9 ms - Source: fl/stl/singleton.h
  8.   386.2 ms - Source: fl/stl/thread_local.h
  9.   385.1 ms - Source: fl/stl/thread.h
 10.   385.0 ms - Source: platforms/thread.h
 11.   385.0 ms - Source: platforms/stub/thread_stub.h
 12.   384.9 ms - Source: platforms/stub/thread_stub_stl.h
 13.   379.5 ms - Source: thread
 14.   276.3 ms - Source: fl/task/promise.h
 15.   252.5 ms - Source: crgb.h
 16.   251.3 ms - Source: std_thread.h
 17.   251.2 ms - Source: fl/gfx/crgb.h
 18.   247.0 ms - Source: fl/math/ease.h
 19.   245.1 ms - Source: fl/math/fixed_point.h
 20.   234.2 ms - Source: fl/stl/function.h

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1384.4ms)
    - fl/task/executor.h (684.2ms)
    - fl/fastled.h (473.4ms)
    - fl/task/scheduler.h (395.7ms)
    - fl/stl/singleton.h (386.9ms)
    - fl/stl/thread_local.h (386.2ms)
    - fl/stl/thread.h (385.1ms)
    - platforms/thread.h (385.0ms)
    - platforms/stub/thread_stub.h (385.0ms)
    - platforms/stub/thread_stub_stl.h (384.9ms)

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

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1384.4ms)
2. Consider optimizing fl/task/executor.h (684.2ms)
3. Consider optimizing fl/fastled.h (473.4ms)

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

@zackees
zackees deleted the feat/audio-silence-gate-tempo branch May 30, 2026 20:01
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.

1 participant