Skip to content

feat: modernize non-linear power scaling#2362

Merged
zackees merged 1 commit intomasterfrom
powertweaks-modern
Apr 21, 2026
Merged

feat: modernize non-linear power scaling#2362
zackees merged 1 commit intomasterfrom
powertweaks-modern

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Apr 20, 2026

This is a refreshed replacement for #1048, rebuilt against current master.

Problem being addressed:

  • the original report showed that FastLED's linear power model can underestimate current draw for mixed colors / white on some LEDs, even when single-channel calibration looks correct
  • that can cause the limiter to miss a configured current budget

What this PR changes:

  • adds a configurable brightness-to-power response exponent for power estimation and brightness limiting
  • keeps the default at 1.0f so existing users retain today's linear behavior unless they opt in
  • applies the configured response consistently in both:
    • per-channel power estimation
    • max-brightness calculation used by the power limiter
  • updates FastLED.getEstimatedPowerInMilliWatts() so its estimate matches the limiter's model
  • gates the newer non-linear implementation on SKETCH_HAS_LARGE_MEMORY
    • low-memory targets keep the legacy linear path automatically
    • larger-memory targets get the newer table-backed implementation
  • adds focused tests for the new non-linear behavior

Why this is different from the original 2020 patch:

  • the old patch no longer maps cleanly onto the current power-management code
  • current master already has a power-model API, so this version keeps the change scoped to today's subsystem instead of replaying the old file-level diff
  • this version does not hard-code one exponent globally for all users; it provides an opt-in calibration knob instead

Deliberate non-goals in this PR:

  • no change to rendered LED brightness behavior, only power estimation / limiting
  • no attempt to solve RGBW power accounting here
  • no attempt to solve APA102HD / HD108 driver-level brightness accounting here

Focused verification:

  • uv run test.py power_mgt
  • uv run test.py power_estimation

If maintainers want to carry the original SK6805-1515 calibration forward, that can now be expressed as a user-configured exponent instead of a library-wide baked-in constant.

Summary by CodeRabbit

  • New Features

    • Add public API to configure and read a non-linear brightness→power scaling exponent; power estimation and limiting now use the configured response (with smaller-memory targets falling back to linear).
  • Documentation

    • Updated power-estimate docs to describe the configurable brightness→power response and reference the new API.
  • Tests

    • Added/updated unit tests validating default linear behavior, non-linear effects on estimated power, and brightness limits under power constraints.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added configurable non-linear brightness→power scaling via a global exponent plus forward/reverse 0–255 lookup tables; power estimation and brightness-clamping now map brightness through these tables. Public APIs to set/get the exponent were added and tests updated to validate linear vs non-linear behavior.

Changes

Cohort / File(s) Summary
Public API / FastLED header
src/FastLED.h
Added CFastLED::setPowerScalingExponent(float) and CFastLED::getPowerScalingExponent() const; made getPowerModel() const; updated docs for setPowerModel() and getEstimatedPowerInMilliWatts() to reference configured power‑brightness response.
FastLED Core
src/FastLED.cpp.hpp
Replaced final brightness scaling from fl::scale32by8(...) to scale_power_for_brightness(...) in CFastLED::getEstimatedPowerInMilliWatts(...); comment updated to reference configured response.
Power Management API
src/power_mgt.h
Added exponent field to PowerModelRGB, PowerModelRGBW, PowerModelRGBWW; updated constructors to accept float e = 1.0f; declared set_power_scaling_exponent(), get_power_scaling_exponent(), and scale_power_for_brightness(...).
Power Management Impl.
src/power_mgt.cpp.hpp
Introduced conditional non-linear scaling gated by SKETCH_HAS_LARGE_MEMORY: added forward/reverse 0–255 LUTs, mapping helpers, scale_power_for_brightness(), and logic to rebuild tables from model exponent; adjusted power calculation and max-brightness limiter to use mapped brightness and reverse mapping when limiting; added set_power_scaling_exponent()/get_power_scaling_exponent().
Tests
tests/fl/power_estimation.cpp, tests/power_mgt.cpp
Fixtures now reset power model in ctor/dtor; added ScopedPowerScalingExponent RAII; new tests assert default linear behavior, higher estimated power with exponent 0.87, exponent travels with model, and more conservative clamp under non-linear exponent.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CFastLED
    participant PowerModel
    participant PowerScalingState
    User->>CFastLED: setPowerScalingExponent(exponent)
    CFastLED->>PowerScalingState: set_power_scaling_exponent(exponent)
    Note over PowerScalingState: rebuild forward/reverse 0–255 tables if available (exponent != 1.0)
    User->>CFastLED: getEstimatedPowerInMilliWatts(apply_limiter)
    CFastLED->>PowerModel: calculate_unscaled_power_mW(LEDs)
    PowerModel-->>CFastLED: total_unscaled_mW
    CFastLED->>PowerScalingState: scale_power_for_brightness(total_unscaled_mW, brightness)
    PowerScalingState-->>CFastLED: adjusted_mW
    CFastLED-->>User: estimated_power_mW
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I nibbled numbers, shaped the curve,
Tables forward, then back they swerve,
Brightness mapped in furry art,
Watts recalculated, chart by chart,
A hopping rabbit tweaks the verve.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% 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 summarizes the main change: adding non-linear power scaling. It directly reflects the primary feature introduced across all modified files.

✏️ 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 powertweaks-modern

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
Copy link
Copy Markdown
Member Author

zackees commented Apr 20, 2026

Maintainer summary:

This is not a literal replay of the 2020 patch. It is the same feature direction reimplemented on top of the current power-management code.

Key review points:

  • default behavior stays unchanged because the exponent defaults to 1.0f
  • the non-linear response is opt-in rather than hard-coded for every chipset
  • the estimator and limiter now use the same response model, so reported power and capped power stay aligned
  • RGBW and APA102HD/HD108 are intentionally left out of scope here because they need a more controller-aware power path

So the tradeoff here is: smaller, reviewable modernization of #1048 now, instead of trying to solve the whole controller-aware power architecture in one PR.

@github-actions
Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 952.01ms

Top 5 Slowest Headers

  1. FastLED.h - 730.54ms
  2. fl/fastled.h - 301.92ms
  3. fl/task/executor.h - 248.81ms
  4. crgb.h - 170.09ms
  5. fl/gfx/crgb.h - 168.89ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (730.5ms)
⚠️ Header fl/fastled.h exceeds 150ms (301.9ms)
⚠️ Header fl/task/executor.h exceeds 150ms (248.8ms)
⚠️ Header crgb.h exceeds 150ms (170.1ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (168.9ms)
⚠️ Header fl/math/ease.h exceeds 150ms (164.6ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (162.8ms)
⚠️ Header fl/task/scheduler.h exceeds 50ms (120.1ms)
⚠️ Header fl/task/promise.h exceeds 50ms (117.3ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (112.1ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (111.5ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (110.5ms)
⚠️ Header platforms/thread.h exceeds 50ms (110.5ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (110.4ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (110.4ms)
⚠️ Header fl/ui.h exceeds 50ms (101.0ms)
⚠️ Header fl/stl/function.h exceeds 50ms (77.6ms)
⚠️ Header fl/stl/json.h exceeds 50ms (62.3ms)
⚠️ Header fl/stl/vector.h exceeds 50ms (51.8ms)
⚠️ Template instantiation time is high (48.4%)

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

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    1,856.39 ms
Frontend Time:             14.35 ms (0.8%)
Backend Time:              158.51 ms (8.5%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    11863.02 ms (639.0%)
Templates                   465.57 ms ( 25.1%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1364.8 ms - FastLED.h (SLOW)
   736.9 ms - fl/task/executor.h (SLOW)
   433.6 ms - fl/fastled.h (SLOW)
   389.6 ms - fl/task/scheduler.h (SLOW)
   381.5 ms - fl/stl/singleton.h (SLOW)
   380.9 ms - fl/stl/thread_local.h (SLOW)
   379.9 ms - fl/stl/thread.h (SLOW)
   379.9 ms - platforms/thread.h (SLOW)
   379.8 ms - platforms/stub/thread_stub.h (SLOW)
   379.8 ms - platforms/stub/thread_stub_stl.h (SLOW)
   335.6 ms - fl/task/promise.h (SLOW)
   295.6 ms - fl/stl/function.h (SLOW)
   271.0 ms - crgb.h (SLOW)
   269.8 ms - fl/gfx/crgb.h (SLOW)
   265.6 ms - fl/math/ease.h (SLOW)
   263.7 ms - fl/math/fixed_point.h (SLOW)
   147.6 ms - fl/math/fixed_point/s4x12.h (SLOW)
   137.0 ms - fl/stl/shared_ptr.h (SLOW)
   131.3 ms - fl/math/sin32.h (SLOW)
   128.7 ms - fl/math/simd.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1364.8ms)
  ├─  736.9 ms - fl/task/executor.h
  │ ├─  389.6 ms - fl/task/scheduler.h
  │ │ ├─  381.5 ms - fl/stl/singleton.h
  │ │ │ └─  380.9 ms - fl/stl/thread_local.h
  │ │ │   └─  379.9 ms - fl/stl/thread.h
  │ │ │     └─  379.9 ms - platforms/thread.h
  │ │ │       └─  379.8 ms - platforms/stub/thread_stub.h
  │ │ │         └─  379.8 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  373.3 ms - thread
  │ │ │             ├─  251.4 ms - std_thread.h
  │ │ │             └─  104.9 ms - this_thread_sleep.h
  │ │ └─    7.3 ms - fl/task/task.h
  │ │   └─    2.8 ms - fl/trace.h
  │ │     ├─    1.8 ms - fl/stl/chrono.h
  │ │     └─    0.8 ms - fl/stl/tuple.h
  │ ├─  335.6 ms - fl/task/promise.h
  │ │ ├─  295.6 ms - fl/stl/function.h
  │ │ │ ├─  137.0 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─  105.2 ms - fl/stl/atomic.h
  │ │ │ │ │ └─  104.4 ms - platforms/atomic.h
  │ │ │ │ │   └─  104.3 ms - platforms/shared/atomic.h
  │ │ │ │ ├─   27.5 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   22.6 ms - fl/stl/move.h
  │ │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ │ ├─   99.0 ms - fl/stl/vector.h
  │ │ │ │ ├─   69.7 ms - fl/math/math.h
  │ │ │ │ │ └─   65.3 ms - fl/stl/undef.h
  │ │ │ │ │   └─  101.6 ms - stdlib.h
  │ │ │ │ │     ├─   50.2 ms - cstdlib
  │ │ │ │ │     │ └─  101.6 ms - stdlib.h
  │ │ │ │ │     │   ├─   50.2 ms - cstdlib
  │ │ │ │ │     │   ├─   11.6 ms - types.h
  │ │ │ │ │     │   └─    0.5 ms - floatn.h
  │ │ │ │ │     ├─   11.6 ms - types.h
  │ │ │ │ │     │ ├─   11.6 ms - types.h
  │ │ │ │ │     │ │ ├─   11.6 ms - types.h
  │ │ │ │ │     │ │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │ │     │ │ ├─    2.0 ms - select.h
  │ │ │ │ │     │ │ └─    1.7 ms - endian.h
  │ │ │ │ │     │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │ │     │ │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │ │     │ ├─    2.0 ms - select.h
  │ │ │ │ │     │ └─    1.7 ms - endian.h
  │ │ │ │ │     └─    0.5 ms - floatn.h
  │ │ │ │ ├─   14.6 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   10.0 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    6.4 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    1.8 ms - fl/stl/unique_ptr.h
  │ │ │ │ ├─    5.9 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.2 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ │ ├─   46.7 ms - fl/stl/variant.h
  │ │ │ │ └─   45.2 ms - fl/stl/new.h
  │ │ │ │   └─   45.1 ms - platforms/new.h
  │ │ │ │     └─   45.1 ms - platforms/shared/new.h
  │ │ │ │       └─   35.5 ms - new
  │ │ │ │         ├─   16.9 ms - c++config.h
  │ │ │ │         │ └─    5.6 ms - os_defines.h
  │ │ │ │         └─    0.6 ms - version.h
  │ │ │ ├─    4.6 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
  │ │ └─   35.5 ms - fl/stl/string.h
  │ │   ├─   10.6 ms - fl/stl/basic_string.h
  │ │   │ ├─    0.9 ms - fl/stl/not_null.h
  │ │   │ └─    0.8 ms - fl/stl/iterator.h
  │ │   ├─    7.0 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
  │ ├─    9.8 ms - platforms/await.h
  │ │ └─    9.4 ms - platforms/coroutine_runtime.h
  │ │   └─    8.0 ms - fl/system/engine_events.h
  │ │     ├─    4.0 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
  ├─  433.6 ms - fl/fastled.h
  │ ├─  271.0 ms - crgb.h
  │ │ ├─  269.8 ms - fl/gfx/crgb.h
  │ │ │ └─  265.6 ms - fl/math/ease.h
  │ │ │   └─  263.7 ms - fl/math/fixed_point.h
  │ │ │     ├─  147.6 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─  131.3 ms - fl/math/sin32.h
  │ │ │     │ │ └─  128.7 ms - fl/math/simd.h
  │ │ │     │ │   └─  128.3 ms - fl/math/simd/types.h
  │ │ │     │ │     └─  128.0 ms - platforms/simd.h
  │ │ │     │ ├─    0.8 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.6 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   14.6 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   14.5 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   14.3 ms - fl/math/fixed_point/s16x16.h
  │ │ │     └─   14.2 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.8 ms - chsv.h
  │ │   └─    0.7 ms - fl/gfx/hsv.h
  │ ├─   76.0 ms - platforms.h
  │ │ └─   75.9 ms - platforms/stub/fastled_stub.h
  │ │   ├─   45.4 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   45.3 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   40.0 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   38.1 ms - fl/id_tracker.h
  │ │   │   │   └─   37.3 ms - fl/stl/mutex.h
  │ │   │   │     └─   37.2 ms - platforms/mutex.h
  │ │   │   │       └─   37.1 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    4.9 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   30.5 ms - platforms/stub/clockless_stub.h
  │ │     └─   30.5 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   11.2 ms - fl/channels/data.h
  │ │       │ └─    8.3 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
  │ │       ├─   10.3 ms - fl/system/log.h
  │ │       │ └─    9.9 ms - fl/stl/strstream.h
  │ │       ├─    2.1 ms - fl/channels/manager.h
  │ │       ├─    1.3 ms - fl/stl/weak_ptr.h
  │ │       └─    0.9 ms - fl/channels/driver.h
  │ ├─   33.0 ms - colorutils.h
  │ │ └─   32.2 ms - fl/gfx/colorutils.h
  │ │   ├─    7.0 ms - fl/gfx/blur.h
  │ │   │ └─    3.8 ms - fl/gfx/canvas.h
  │ │   │   └─    2.3 ms - fl/math/alpha.h
  │ │   └─    2.6 ms - fl/gfx/fill.h
  │ ├─   18.7 ms - pixel_controller.h
  │ │ ├─   13.2 ms - pixel_iterator.h
  │ │ │ └─   13.2 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    3.8 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    2.9 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    2.4 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    3.5 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.2 ms - rgbw.h
  │ │   └─    2.0 ms - fl/gfx/rgbw.h
  │ └─   17.0 ms - pixeltypes.h
  │   ├─   14.3 ms - lib8tion.h
  │   │ ├─    7.2 ms - fl/math/math8.h
  │   │ │ ├─    3.6 ms - fl/math/intmap.h
  │   │ │ │ └─    2.8 ms - platforms/intmap.h
  │   │ │ ├─    1.9 ms - fl/math/scale8.h
  │   │ │ │ └─    1.8 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.5 ms - fl/math/beat.h
  │   │   └─    0.8 ms - fl/math/trig8.h
  │   │     └─    0.8 ms - platforms/trig8.h
  │   │       └─    0.7 ms - platforms/shared/trig8.h
  │   └─    2.4 ms - crgb.hpp
  ├─  101.4 ms - fl/ui.h
  │ ├─   62.7 ms - fl/stl/json.h
  │ │ └─   49.4 ms - fl/stl/json/types.h
  │ │   └─    5.5 ms - fl/stl/limits.h
  │ ├─    9.0 ms - fl/ui_impl.h
  │ │ └─    8.5 ms - platforms/ui_defs.h
  │ │   ├─    1.8 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    0.9 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.5 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.7 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/description.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/number_field.h
  │ │   └─    0.7 ms - platforms/shared/ui/json/help.h
  │ └─    7.4 ms - fl/asset.h
  │   └─    6.5 ms - fl/stl/url.h
  ├─   23.5 ms - chipsets.h
  │ ├─    9.7 ms - fl/chipsets/ucs7604.h
  │ │ └─    7.3 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    5.6 ms - fl/chipsets/apa102.h
  │ ├─    1.4 ms - fl/chipsets/lpd880x.h
  │ ├─    0.7 ms - fl/chipsets/encoders/ws2816.h
  │ └─    0.7 ms - fl/chipsets/p9813.h
  └─   19.2 ms - fl/audio/audio_processor.h
    ├─    4.8 ms - fl/audio/audio_context.h
    │ └─    1.4 ms - fl/audio/fft/fft.h
    ├─    1.8 ms - fl/audio/detector/vibe.h
    └─    0.8 ms - fl/audio/signal_conditioner.h
fl/task/executor.h (736.9ms)
  ├─  389.6 ms - fl/task/scheduler.h
  │ ├─  381.5 ms - fl/stl/singleton.h
  │ │ └─  380.9 ms - fl/stl/thread_local.h
  │ │   └─  379.9 ms - fl/stl/thread.h
  │ │     └─  379.9 ms - platforms/thread.h
  │ │       └─  379.8 ms - platforms/stub/thread_stub.h
  │ │         └─  379.8 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  373.3 ms - thread
  │ │             ├─  251.4 ms - std_thread.h
  │ │             │ ├─  142.3 ms - tuple
  │ │             │ ├─   30.3 ms - iosfwd
  │ │             │ ├─   20.6 ms - refwrap.h
  │ │             │ ├─   10.6 ms - gthr.h
  │ │             │ └─    5.4 ms - unique_ptr.h
  │ │             └─  104.9 ms - this_thread_sleep.h
  │ │               ├─   89.8 ms - chrono.h
  │ │               └─    3.9 ms - cerrno
  │ └─    7.3 ms - fl/task/task.h
  │   └─    2.8 ms - fl/trace.h
  │     ├─    1.8 ms - fl/stl/chrono.h
  │     └─    0.8 ms - fl/stl/tuple.h
  ├─  335.6 ms - fl/task/promise.h
  │ ├─  295.6 ms - fl/stl/function.h
  │ │ ├─  137.0 ms - fl/stl/shared_ptr.h
  │ │ │ ├─  105.2 ms - fl/stl/atomic.h
  │ │ │ │ └─  104.4 ms - platforms/atomic.h
  │ │ │ │   └─  104.3 ms - platforms/shared/atomic.h
  │ │ │ ├─   27.5 ms - fl/stl/type_traits.h
  │ │ │ │ └─   22.6 ms - fl/stl/move.h
  │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ ├─   99.0 ms - fl/stl/vector.h
  │ │ │ ├─   69.7 ms - fl/math/math.h
  │ │ │ │ └─   65.3 ms - fl/stl/undef.h
  │ │ │ │   └─  101.6 ms - stdlib.h
  │ │ │ │     ├─   50.2 ms - cstdlib
  │ │ │ │     │ └─  101.6 ms - stdlib.h
  │ │ │ │     │   ├─   50.2 ms - cstdlib
  │ │ │ │     │   │ └─  101.6 ms - stdlib.h
  │ │ │ │     │   ├─   11.6 ms - types.h
  │ │ │ │     │   │ ├─   11.6 ms - types.h
  │ │ │ │     │   │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │     │   │ ├─    2.0 ms - select.h
  │ │ │ │     │   │ └─    1.7 ms - endian.h
  │ │ │ │     │   └─    0.5 ms - floatn.h
  │ │ │ │     ├─   11.6 ms - types.h
  │ │ │ │     │ ├─   11.6 ms - types.h
  │ │ │ │     │ │ ├─   11.6 ms - types.h
  │ │ │ │     │ │ │ ├─   11.6 ms - types.h
  │ │ │ │     │ │ │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │     │ │ │ ├─    2.0 ms - select.h
  │ │ │ │     │ │ │ └─    1.7 ms - endian.h
  │ │ │ │     │ │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │     │ │ │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │     │ │ ├─    2.0 ms - select.h
  │ │ │ │     │ │ └─    1.7 ms - endian.h
  │ │ │ │     │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │     │ │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │     │ ├─    2.0 ms - select.h
  │ │ │ │     │ └─    1.7 ms - endian.h
  │ │ │ │     └─    0.5 ms - floatn.h
  │ │ │ ├─   14.6 ms - fl/stl/allocator.h
  │ │ │ │ └─   10.0 ms - fl/stl/bitset.h
  │ │ │ │   └─    6.4 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    1.8 ms - fl/stl/unique_ptr.h
  │ │ │ ├─    5.9 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.2 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ ├─   46.7 ms - fl/stl/variant.h
  │ │ │ └─   45.2 ms - fl/stl/new.h
  │ │ │   └─   45.1 ms - platforms/new.h
  │ │ │     └─   45.1 ms - platforms/shared/new.h
  │ │ │       └─   35.5 ms - new
  │ │ │         ├─   16.9 ms - c++config.h
  │ │ │         │ └─    5.6 ms - os_defines.h
  │ │ │         │   └─    5.2 ms - features.h
  │ │ │         └─    0.6 ms - version.h
  │ │ ├─    4.6 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
  │ └─   35.5 ms - fl/stl/string.h
  │   ├─   10.6 ms - fl/stl/basic_string.h
  │   │ ├─    0.9 ms - fl/stl/not_null.h
  │   │ └─    0.8 ms - fl/stl/iterator.h
  │   ├─    7.0 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
  ├─    9.8 ms - platforms/await.h
  │ └─    9.4 ms - platforms/coroutine_runtime.h
  │   └─    8.0 ms - fl/system/engine_events.h
  │     ├─    4.0 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 (433.6ms)
  ├─  271.0 ms - crgb.h
  │ ├─  269.8 ms - fl/gfx/crgb.h
  │ │ └─  265.6 ms - fl/math/ease.h
  │ │   └─  263.7 ms - fl/math/fixed_point.h
  │ │     ├─  147.6 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─  131.3 ms - fl/math/sin32.h
  │ │     │ │ └─  128.7 ms - fl/math/simd.h
  │ │     │ │   └─  128.3 ms - fl/math/simd/types.h
  │ │     │ │     └─  128.0 ms - platforms/simd.h
  │ │     │ │       └─  128.0 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    0.8 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.6 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   14.6 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   14.5 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   14.3 ms - fl/math/fixed_point/s16x16.h
  │ │     └─   14.2 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.8 ms - chsv.h
  │   └─    0.7 ms - fl/gfx/hsv.h
  ├─   76.0 ms - platforms.h
  │ └─   75.9 ms - platforms/stub/fastled_stub.h
  │   ├─   45.4 ms - platforms/stub/fastspi_stub.h
  │   │ └─   45.3 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   40.0 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   38.1 ms - fl/id_tracker.h
  │   │   │   └─   37.3 ms - fl/stl/mutex.h
  │   │   │     └─   37.2 ms - platforms/mutex.h
  │   │   │       └─   37.1 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   37.1 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    4.9 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   30.5 ms - platforms/stub/clockless_stub.h
  │     └─   30.5 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   11.2 ms - fl/channels/data.h
  │       │ └─    8.3 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
  │       ├─   10.3 ms - fl/system/log.h
  │       │ └─    9.9 ms - fl/stl/strstream.h
  │       ├─    2.1 ms - fl/channels/manager.h
  │       ├─    1.3 ms - fl/stl/weak_ptr.h
  │       └─    0.9 ms - fl/channels/driver.h
  ├─   33.0 ms - colorutils.h
  │ └─   32.2 ms - fl/gfx/colorutils.h
  │   ├─    7.0 ms - fl/gfx/blur.h
  │   │ └─    3.8 ms - fl/gfx/canvas.h
  │   │   └─    2.3 ms - fl/math/alpha.h
  │   └─    2.6 ms - fl/gfx/fill.h
  ├─   18.7 ms - pixel_controller.h
  │ ├─   13.2 ms - pixel_iterator.h
  │ │ └─   13.2 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    3.8 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    2.9 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    2.4 ms - fl/gfx/gamma_lut.h
  │ │   ├─    3.5 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.2 ms - rgbw.h
  │   └─    2.0 ms - fl/gfx/rgbw.h
  └─   17.0 ms - pixeltypes.h
    ├─   14.3 ms - lib8tion.h
    │ ├─    7.2 ms - fl/math/math8.h
    │ │ ├─    3.6 ms - fl/math/intmap.h
    │ │ │ └─    2.8 ms - platforms/intmap.h
    │ │ ├─    1.9 ms - fl/math/scale8.h
    │ │ │ └─    1.8 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.5 ms - fl/math/beat.h
    │   └─    0.8 ms - fl/math/trig8.h
    │     └─    0.8 ms - platforms/trig8.h
    │       └─    0.7 ms - platforms/shared/trig8.h
    └─    2.4 ms - crgb.hpp
fl/ui.h (101.4ms)
  ├─   62.7 ms - fl/stl/json.h
  │ └─   49.4 ms - fl/stl/json/types.h
  │   └─    5.5 ms - fl/stl/limits.h
  ├─    9.0 ms - fl/ui_impl.h
  │ └─    8.5 ms - platforms/ui_defs.h
  │   ├─    1.8 ms - platforms/shared/ui/json/audio.h
  │   │ └─    0.9 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.5 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.7 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    0.8 ms - platforms/shared/ui/json/description.h
  │   ├─    0.8 ms - platforms/shared/ui/json/number_field.h
  │   └─    0.7 ms - platforms/shared/ui/json/help.h
  └─    7.4 ms - fl/asset.h
    └─    6.5 ms - fl/stl/url.h
chipsets.h (23.5ms)
  ├─    9.7 ms - fl/chipsets/ucs7604.h
  │ └─    7.3 ms - fl/chipsets/encoders/ucs7604.h
  ├─    5.6 ms - fl/chipsets/apa102.h
  ├─    1.4 ms - fl/chipsets/lpd880x.h
  ├─    0.7 ms - fl/chipsets/encoders/ws2816.h
  └─    0.7 ms - fl/chipsets/p9813.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1364.8 ms - Source: FastLED.h
  2.  1364.8 ms - Total Source: 
  3.   736.9 ms - Source: fl/task/executor.h
  4.   623.8 ms - Total ParseClass: 
  5.   433.6 ms - Source: fl/fastled.h
  6.   389.6 ms - Source: fl/task/scheduler.h
  7.   381.5 ms - Source: fl/stl/singleton.h
  8.   380.9 ms - Source: fl/stl/thread_local.h
  9.   379.9 ms - Source: fl/stl/thread.h
 10.   379.9 ms - Source: platforms/thread.h
 11.   379.8 ms - Source: platforms/stub/thread_stub.h
 12.   379.8 ms - Source: platforms/stub/thread_stub_stl.h
 13.   373.3 ms - Source: thread
 14.   335.6 ms - Source: fl/task/promise.h
 15.   295.6 ms - Source: fl/stl/function.h
 16.   271.0 ms - Source: crgb.h
 17.   269.8 ms - Source: fl/gfx/crgb.h
 18.   265.6 ms - Source: fl/math/ease.h
 19.   263.7 ms - Source: fl/math/fixed_point.h
 20.   251.4 ms - Source: std_thread.h

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1364.8ms)
    - fl/task/executor.h (736.9ms)
    - fl/fastled.h (433.6ms)
    - fl/task/scheduler.h (389.6ms)
    - fl/stl/singleton.h (381.5ms)
    - fl/stl/thread_local.h (380.9ms)
    - fl/stl/thread.h (379.9ms)
    - platforms/thread.h (379.9ms)
    - platforms/stub/thread_stub.h (379.8ms)
    - platforms/stub/thread_stub_stl.h (379.8ms)

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

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1364.8ms)
2. Consider optimizing fl/task/executor.h (736.9ms)
3. Consider optimizing fl/fastled.h (433.6ms)

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

@github-actions
Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 1246.89ms

Top 5 Slowest Headers

  1. FastLED.h - 954.99ms
  2. fl/fastled.h - 400.73ms
  3. fl/task/executor.h - 314.71ms
  4. crgb.h - 227.10ms
  5. fl/gfx/crgb.h - 225.68ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (955.0ms)
⚠️ Header fl/fastled.h exceeds 150ms (400.7ms)
⚠️ Header fl/task/executor.h exceeds 150ms (314.7ms)
⚠️ Header crgb.h exceeds 150ms (227.1ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (225.7ms)
⚠️ Header fl/math/ease.h exceeds 150ms (220.5ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (218.0ms)
⚠️ Header fl/task/scheduler.h exceeds 150ms (168.0ms)
⚠️ Header fl/stl/singleton.h exceeds 150ms (157.5ms)
⚠️ Header fl/stl/thread_local.h exceeds 150ms (156.7ms)
⚠️ Header fl/stl/thread.h exceeds 150ms (155.4ms)
⚠️ Header platforms/thread.h exceeds 150ms (155.3ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 150ms (155.3ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 150ms (155.2ms)
⚠️ Header fl/ui.h exceeds 50ms (134.9ms)
⚠️ Header fl/task/promise.h exceeds 50ms (132.0ms)
⚠️ Header fl/stl/json.h exceeds 50ms (84.9ms)
⚠️ Header fl/stl/function.h exceeds 50ms (79.0ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (65.8ms)
⚠️ Header fl/math/fixed_point/s4x12.h exceeds 50ms (64.9ms)
⚠️ Header platforms.h exceeds 50ms (58.7ms)
⚠️ Header platforms/stub/fastled_stub.h exceeds 50ms (58.7ms)
⚠️ Template instantiation time is high (55.1%)

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

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    2,393.88 ms
Frontend Time:             24.37 ms (1.0%)
Backend Time:              256.17 ms (10.7%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    13228.17 ms (552.6%)
Templates                   722.53 ms ( 30.2%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1652.1 ms - FastLED.h (SLOW)
   790.1 ms - fl/task/executor.h (SLOW)
   512.4 ms - fl/fastled.h (SLOW)
   419.4 ms - fl/task/scheduler.h (SLOW)
   408.8 ms - fl/stl/singleton.h (SLOW)
   408.0 ms - fl/stl/thread_local.h (SLOW)
   406.7 ms - fl/stl/thread.h (SLOW)
   406.6 ms - platforms/thread.h (SLOW)
   406.6 ms - platforms/stub/thread_stub.h (SLOW)
   406.5 ms - platforms/stub/thread_stub_stl.h (SLOW)
   355.8 ms - fl/task/promise.h (SLOW)
   304.4 ms - crgb.h (SLOW)
   303.0 ms - fl/gfx/crgb.h (SLOW)
   302.1 ms - fl/stl/function.h (SLOW)
   297.7 ms - fl/math/ease.h (SLOW)
   295.1 ms - fl/math/fixed_point.h (SLOW)
   161.8 ms - fl/ui.h (SLOW)
   138.0 ms - fl/math/fixed_point/s4x12.h (SLOW)
   120.5 ms - fl/stl/shared_ptr.h (SLOW)
   116.0 ms - fl/math/sin32.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1652.1ms)
  ├─  790.1 ms - fl/task/executor.h
  │ ├─  419.4 ms - fl/task/scheduler.h
  │ │ ├─  408.8 ms - fl/stl/singleton.h
  │ │ │ └─  408.0 ms - fl/stl/thread_local.h
  │ │ │   └─  406.7 ms - fl/stl/thread.h
  │ │ │     └─  406.6 ms - platforms/thread.h
  │ │ │       └─  406.6 ms - platforms/stub/thread_stub.h
  │ │ │         └─  406.5 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  400.9 ms - thread
  │ │ │             ├─  230.5 ms - std_thread.h
  │ │ │             └─  153.6 ms - this_thread_sleep.h
  │ │ └─    9.6 ms - fl/task/task.h
  │ │   └─    3.8 ms - fl/trace.h
  │ │     ├─    2.3 ms - fl/stl/chrono.h
  │ │     └─    1.1 ms - fl/stl/tuple.h
  │ ├─  355.8 ms - fl/task/promise.h
  │ │ ├─  302.1 ms - fl/stl/function.h
  │ │ │ ├─  120.5 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   94.6 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   87.7 ms - fl/stl/move.h
  │ │ │ │ ├─   20.5 ms - fl/stl/atomic.h
  │ │ │ │ │ └─   19.4 ms - platforms/atomic.h
  │ │ │ │ │   └─   19.3 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ │ ├─   85.7 ms - fl/stl/vector.h
  │ │ │ │ ├─   47.5 ms - fl/math/math.h
  │ │ │ │ │ └─   41.5 ms - fl/stl/undef.h
  │ │ │ │ │   └─   60.5 ms - stdlib.h
  │ │ │ │ │     ├─   30.8 ms - cstdlib
  │ │ │ │ │     │ ├─   60.5 ms - stdlib.h
  │ │ │ │ │     │ │ ├─   30.8 ms - cstdlib
  │ │ │ │ │     │ │ ├─   11.8 ms - types.h
  │ │ │ │ │     │ │ └─    0.6 ms - floatn.h
  │ │ │ │ │     │ └─    0.7 ms - std_abs.h
  │ │ │ │ │     ├─   11.8 ms - types.h
  │ │ │ │ │     │ ├─   11.8 ms - types.h
  │ │ │ │ │     │ │ ├─   11.8 ms - types.h
  │ │ │ │ │     │ │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │ │     │ │ ├─    2.1 ms - select.h
  │ │ │ │ │     │ │ └─    2.1 ms - endian.h
  │ │ │ │ │     │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │ │     │ │ └─    1.7 ms - thread-shared-types.h
  │ │ │ │ │     │ ├─    2.1 ms - select.h
  │ │ │ │ │     │ └─    2.1 ms - endian.h
  │ │ │ │ │     └─    0.6 ms - floatn.h
  │ │ │ │ ├─   19.9 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   13.6 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    8.7 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    2.3 ms - fl/stl/unique_ptr.h
  │ │ │ │ ├─    6.3 ms - fl/stl/initializer_list.h
  │ │ │ │ │ └─    0.5 ms - initializer_list
  │ │ │ │ ├─    3.1 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.8 ms - fl/stl/functional.h
  │ │ │ ├─   79.6 ms - fl/stl/variant.h
  │ │ │ │ └─   77.6 ms - fl/stl/new.h
  │ │ │ │   └─   77.5 ms - platforms/new.h
  │ │ │ │     └─   77.5 ms - platforms/shared/new.h
  │ │ │ │       └─   67.7 ms - new
  │ │ │ │         ├─   16.7 ms - c++config.h
  │ │ │ │         │ └─    5.9 ms - os_defines.h
  │ │ │ │         └─    0.6 ms - version.h
  │ │ │ ├─    5.1 ms - fl/stl/compiler_control.h
  │ │ │ └─    5.0 ms - fl/stl/algorithm.h
  │ │ │   └─    2.1 ms - fl/math/random.h
  │ │ │     └─    1.0 ms - fl/math/random8.h
  │ │ └─   47.8 ms - fl/stl/string.h
  │ │   ├─   13.9 ms - fl/stl/basic_string.h
  │ │   │ ├─    1.1 ms - fl/stl/not_null.h
  │ │   │ ├─    1.0 ms - fl/stl/iterator.h
  │ │   │ └─    0.5 ms - fl/stl/charconv.h
  │ │   ├─    9.6 ms - fl/stl/span.h
  │ │   │ └─    3.7 ms - fl/math/geometry.h
  │ │   ├─    5.9 ms - fl/stl/string_view.h
  │ │   └─    1.6 ms - fl/stl/optional.h
  │ ├─   12.4 ms - platforms/await.h
  │ │ └─   12.0 ms - platforms/coroutine_runtime.h
  │ │   └─   10.1 ms - fl/system/engine_events.h
  │ │     ├─    5.3 ms - fl/math/screenmap.h
  │ │     │ └─    3.9 ms - fl/stl/flat_map.h
  │ │     └─    3.2 ms - fl/math/xymap.h
  │ │       └─    0.8 ms - fl/math/lut.h
  │ └─    0.9 ms - fl/task/promise_result.h
  ├─  512.4 ms - fl/fastled.h
  │ ├─  304.4 ms - crgb.h
  │ │ ├─  303.0 ms - fl/gfx/crgb.h
  │ │ │ └─  297.7 ms - fl/math/ease.h
  │ │ │   └─  295.1 ms - fl/math/fixed_point.h
  │ │ │     ├─  138.0 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─  116.0 ms - fl/math/sin32.h
  │ │ │     │ │ └─  112.7 ms - fl/math/simd.h
  │ │ │     │ │   └─  112.1 ms - fl/math/simd/types.h
  │ │ │     │ │     └─  111.7 ms - platforms/simd.h
  │ │ │     │ ├─    1.1 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.9 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   19.8 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   19.4 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   19.2 ms - fl/math/fixed_point/s24x8.h
  │ │ │     └─   19.1 ms - fl/math/fixed_point/s16x16.h
  │ │ └─    0.9 ms - chsv.h
  │ │   └─    0.8 ms - fl/gfx/hsv.h
  │ ├─   90.4 ms - platforms.h
  │ │ └─   90.3 ms - platforms/stub/fastled_stub.h
  │ │   ├─   49.2 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   49.2 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   42.3 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   39.9 ms - fl/id_tracker.h
  │ │   │   │   └─   38.9 ms - fl/stl/mutex.h
  │ │   │   │     └─   38.8 ms - platforms/mutex.h
  │ │   │   │       └─   38.7 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    6.4 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   41.0 ms - platforms/stub/clockless_stub.h
  │ │     └─   40.9 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   14.4 ms - fl/channels/data.h
  │ │       │ └─   10.8 ms - fl/channels/config.h
  │ │       │   ├─    2.3 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.5 ms - fl/chipsets/led_timing.h
  │ │       │   └─    2.0 ms - fl/chipsets/spi.h
  │ │       ├─   14.3 ms - fl/system/log.h
  │ │       │ └─   13.8 ms - fl/stl/strstream.h
  │ │       ├─    2.8 ms - fl/channels/manager.h
  │ │       ├─    1.7 ms - fl/stl/weak_ptr.h
  │ │       └─    1.2 ms - fl/channels/driver.h
  │ ├─   45.0 ms - colorutils.h
  │ │ └─   44.1 ms - fl/gfx/colorutils.h
  │ │   ├─    9.5 ms - fl/gfx/blur.h
  │ │   │ └─    5.1 ms - fl/gfx/canvas.h
  │ │   │   └─    3.1 ms - fl/math/alpha.h
  │ │   └─    3.4 ms - fl/gfx/fill.h
  │ ├─   25.1 ms - pixel_controller.h
  │ │ ├─   18.1 ms - pixel_iterator.h
  │ │ │ └─   18.0 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    5.3 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    4.1 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    3.4 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    4.7 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    1.1 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.9 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.7 ms - rgbw.h
  │ │   └─    2.5 ms - fl/gfx/rgbw.h
  │ └─   24.1 ms - pixeltypes.h
  │   ├─   20.2 ms - lib8tion.h
  │   │ ├─   10.5 ms - fl/math/math8.h
  │   │ │ ├─    5.6 ms - fl/math/intmap.h
  │   │ │ │ └─    4.3 ms - platforms/intmap.h
  │   │ │ ├─    2.6 ms - fl/math/scale8.h
  │   │ │ │ └─    2.5 ms - platforms/scale8.h
  │   │ │ │   └─    1.1 ms - platforms/shared/scale8.h
  │   │ │ └─    2.2 ms - platforms/math8.h
  │   │ │   └─    1.8 ms - platforms/shared/math8.h
  │   │ ├─    2.1 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.6 ms - fl/math/qfx.h
  │   │ └─    0.5 ms - fl/math/time_functions.h
  │   └─    3.4 ms - crgb.hpp
  ├─  161.8 ms - fl/ui.h
  │ ├─  105.6 ms - fl/stl/json.h
  │ │ └─   77.5 ms - fl/stl/json/types.h
  │ │   └─    7.8 ms - fl/stl/limits.h
  │ ├─   15.5 ms - fl/ui_impl.h
  │ │ └─   14.6 ms - platforms/ui_defs.h
  │ │   ├─    3.6 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    1.8 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    2.7 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    1.3 ms - platforms/shared/ui/json/ui_internal.h
  │ │   │   └─    0.5 ms - fl/stl/memory.h
  │ │   ├─    1.2 ms - platforms/shared/ui/json/description.h
  │ │   ├─    1.2 ms - platforms/shared/ui/json/number_field.h
  │ │   └─    1.2 ms - platforms/shared/ui/json/help.h
  │ └─   10.2 ms - fl/asset.h
  │   └─    9.0 ms - fl/stl/url.h
  ├─   78.7 ms - fl/stl/stdint.h
  │ └─   78.4 ms - platforms/int.h
  │   └─   77.9 ms - platforms/shared/int.h
  │     └─   77.8 ms - platforms/shared/int_linux.h
  └─   30.6 ms - chipsets.h
    ├─   12.3 ms - fl/chipsets/ucs7604.h
    │ └─    9.2 ms - fl/chipsets/encoders/ucs7604.h
    ├─    7.3 ms - fl/chipsets/apa102.h
    ├─    1.8 ms - fl/chipsets/lpd880x.h
    ├─    0.9 ms - fl/chipsets/p9813.h
    └─    0.9 ms - fl/chipsets/encoders/ws2816.h
fl/task/executor.h (790.1ms)
  ├─  419.4 ms - fl/task/scheduler.h
  │ ├─  408.8 ms - fl/stl/singleton.h
  │ │ └─  408.0 ms - fl/stl/thread_local.h
  │ │   └─  406.7 ms - fl/stl/thread.h
  │ │     └─  406.6 ms - platforms/thread.h
  │ │       └─  406.6 ms - platforms/stub/thread_stub.h
  │ │         └─  406.5 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  400.9 ms - thread
  │ │             ├─  230.5 ms - std_thread.h
  │ │             │ ├─   65.4 ms - tuple
  │ │             │ ├─   53.2 ms - refwrap.h
  │ │             │ ├─   46.2 ms - iosfwd
  │ │             │ ├─   13.2 ms - gthr.h
  │ │             │ └─    7.1 ms - unique_ptr.h
  │ │             └─  153.6 ms - this_thread_sleep.h
  │ │               ├─  105.5 ms - chrono.h
  │ │               └─    4.5 ms - cerrno
  │ └─    9.6 ms - fl/task/task.h
  │   └─    3.8 ms - fl/trace.h
  │     ├─    2.3 ms - fl/stl/chrono.h
  │     └─    1.1 ms - fl/stl/tuple.h
  ├─  355.8 ms - fl/task/promise.h
  │ ├─  302.1 ms - fl/stl/function.h
  │ │ ├─  120.5 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   94.6 ms - fl/stl/type_traits.h
  │ │ │ │ └─   87.7 ms - fl/stl/move.h
  │ │ │ ├─   20.5 ms - fl/stl/atomic.h
  │ │ │ │ └─   19.4 ms - platforms/atomic.h
  │ │ │ │   └─   19.3 ms - platforms/shared/atomic.h
  │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ ├─   85.7 ms - fl/stl/vector.h
  │ │ │ ├─   47.5 ms - fl/math/math.h
  │ │ │ │ └─   41.5 ms - fl/stl/undef.h
  │ │ │ │   └─   60.5 ms - stdlib.h
  │ │ │ │     ├─   30.8 ms - cstdlib
  │ │ │ │     │ ├─   60.5 ms - stdlib.h
  │ │ │ │     │ │ ├─   30.8 ms - cstdlib
  │ │ │ │     │ │ │ ├─   60.5 ms - stdlib.h
  │ │ │ │     │ │ │ └─    0.7 ms - std_abs.h
  │ │ │ │     │ │ ├─   11.8 ms - types.h
  │ │ │ │     │ │ │ ├─   11.8 ms - types.h
  │ │ │ │     │ │ │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │     │ │ │ ├─    2.1 ms - select.h
  │ │ │ │     │ │ │ └─    2.1 ms - endian.h
  │ │ │ │     │ │ └─    0.6 ms - floatn.h
  │ │ │ │     │ └─    0.7 ms - std_abs.h
  │ │ │ │     ├─   11.8 ms - types.h
  │ │ │ │     │ ├─   11.8 ms - types.h
  │ │ │ │     │ │ ├─   11.8 ms - types.h
  │ │ │ │     │ │ │ ├─   11.8 ms - types.h
  │ │ │ │     │ │ │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │     │ │ │ ├─    2.1 ms - select.h
  │ │ │ │     │ │ │ └─    2.1 ms - endian.h
  │ │ │ │     │ │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │     │ │ │ └─    1.7 ms - thread-shared-types.h
  │ │ │ │     │ │ ├─    2.1 ms - select.h
  │ │ │ │     │ │ └─    2.1 ms - endian.h
  │ │ │ │     │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │     │ │ └─    1.7 ms - thread-shared-types.h
  │ │ │ │     │ ├─    2.1 ms - select.h
  │ │ │ │     │ └─    2.1 ms - endian.h
  │ │ │ │     └─    0.6 ms - floatn.h
  │ │ │ ├─   19.9 ms - fl/stl/allocator.h
  │ │ │ │ └─   13.6 ms - fl/stl/bitset.h
  │ │ │ │   └─    8.7 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    2.3 ms - fl/stl/unique_ptr.h
  │ │ │ ├─    6.3 ms - fl/stl/initializer_list.h
  │ │ │ │ └─    0.5 ms - initializer_list
  │ │ │ ├─    3.1 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.8 ms - fl/stl/functional.h
  │ │ ├─   79.6 ms - fl/stl/variant.h
  │ │ │ └─   77.6 ms - fl/stl/new.h
  │ │ │   └─   77.5 ms - platforms/new.h
  │ │ │     └─   77.5 ms - platforms/shared/new.h
  │ │ │       └─   67.7 ms - new
  │ │ │         ├─   16.7 ms - c++config.h
  │ │ │         │ └─    5.9 ms - os_defines.h
  │ │ │         │   └─    5.4 ms - features.h
  │ │ │         └─    0.6 ms - version.h
  │ │ ├─    5.1 ms - fl/stl/compiler_control.h
  │ │ └─    5.0 ms - fl/stl/algorithm.h
  │ │   └─    2.1 ms - fl/math/random.h
  │ │     └─    1.0 ms - fl/math/random8.h
  │ └─   47.8 ms - fl/stl/string.h
  │   ├─   13.9 ms - fl/stl/basic_string.h
  │   │ ├─    1.1 ms - fl/stl/not_null.h
  │   │ ├─    1.0 ms - fl/stl/iterator.h
  │   │ └─    0.5 ms - fl/stl/charconv.h
  │   ├─    9.6 ms - fl/stl/span.h
  │   │ └─    3.7 ms - fl/math/geometry.h
  │   ├─    5.9 ms - fl/stl/string_view.h
  │   └─    1.6 ms - fl/stl/optional.h
  ├─   12.4 ms - platforms/await.h
  │ └─   12.0 ms - platforms/coroutine_runtime.h
  │   └─   10.1 ms - fl/system/engine_events.h
  │     ├─    5.3 ms - fl/math/screenmap.h
  │     │ └─    3.9 ms - fl/stl/flat_map.h
  │     └─    3.2 ms - fl/math/xymap.h
  │       └─    0.8 ms - fl/math/lut.h
  └─    0.9 ms - fl/task/promise_result.h
fl/fastled.h (512.4ms)
  ├─  304.4 ms - crgb.h
  │ ├─  303.0 ms - fl/gfx/crgb.h
  │ │ └─  297.7 ms - fl/math/ease.h
  │ │   └─  295.1 ms - fl/math/fixed_point.h
  │ │     ├─  138.0 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─  116.0 ms - fl/math/sin32.h
  │ │     │ │ └─  112.7 ms - fl/math/simd.h
  │ │     │ │   └─  112.1 ms - fl/math/simd/types.h
  │ │     │ │     └─  111.7 ms - platforms/simd.h
  │ │     │ │       └─  111.7 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    1.1 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.9 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   19.8 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   19.4 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   19.2 ms - fl/math/fixed_point/s24x8.h
  │ │     └─   19.1 ms - fl/math/fixed_point/s16x16.h
  │ └─    0.9 ms - chsv.h
  │   └─    0.8 ms - fl/gfx/hsv.h
  ├─   90.4 ms - platforms.h
  │ └─   90.3 ms - platforms/stub/fastled_stub.h
  │   ├─   49.2 ms - platforms/stub/fastspi_stub.h
  │   │ └─   49.2 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   42.3 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   39.9 ms - fl/id_tracker.h
  │   │   │   └─   38.9 ms - fl/stl/mutex.h
  │   │   │     └─   38.8 ms - platforms/mutex.h
  │   │   │       └─   38.7 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   38.6 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    6.4 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   41.0 ms - platforms/stub/clockless_stub.h
  │     └─   40.9 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   14.4 ms - fl/channels/data.h
  │       │ └─   10.8 ms - fl/channels/config.h
  │       │   ├─    2.3 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.5 ms - fl/chipsets/led_timing.h
  │       │   └─    2.0 ms - fl/chipsets/spi.h
  │       ├─   14.3 ms - fl/system/log.h
  │       │ └─   13.8 ms - fl/stl/strstream.h
  │       ├─    2.8 ms - fl/channels/manager.h
  │       ├─    1.7 ms - fl/stl/weak_ptr.h
  │       └─    1.2 ms - fl/channels/driver.h
  ├─   45.0 ms - colorutils.h
  │ └─   44.1 ms - fl/gfx/colorutils.h
  │   ├─    9.5 ms - fl/gfx/blur.h
  │   │ └─    5.1 ms - fl/gfx/canvas.h
  │   │   └─    3.1 ms - fl/math/alpha.h
  │   └─    3.4 ms - fl/gfx/fill.h
  ├─   25.1 ms - pixel_controller.h
  │ ├─   18.1 ms - pixel_iterator.h
  │ │ └─   18.0 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    5.3 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    4.1 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    3.4 ms - fl/gfx/gamma_lut.h
  │ │   ├─    4.7 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    1.1 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.9 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.7 ms - rgbw.h
  │   └─    2.5 ms - fl/gfx/rgbw.h
  └─   24.1 ms - pixeltypes.h
    ├─   20.2 ms - lib8tion.h
    │ ├─   10.5 ms - fl/math/math8.h
    │ │ ├─    5.6 ms - fl/math/intmap.h
    │ │ │ └─    4.3 ms - platforms/intmap.h
    │ │ ├─    2.6 ms - fl/math/scale8.h
    │ │ │ └─    2.5 ms - platforms/scale8.h
    │ │ │   └─    1.1 ms - platforms/shared/scale8.h
    │ │ └─    2.2 ms - platforms/math8.h
    │ │   └─    1.8 ms - platforms/shared/math8.h
    │ ├─    2.1 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.6 ms - fl/math/qfx.h
    │ └─    0.5 ms - fl/math/time_functions.h
    └─    3.4 ms - crgb.hpp
fl/ui.h (161.8ms)
  ├─  105.6 ms - fl/stl/json.h
  │ └─   77.5 ms - fl/stl/json/types.h
  │   └─    7.8 ms - fl/stl/limits.h
  ├─   15.5 ms - fl/ui_impl.h
  │ └─   14.6 ms - platforms/ui_defs.h
  │   ├─    3.6 ms - platforms/shared/ui/json/audio.h
  │   │ └─    1.8 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    2.7 ms - platforms/shared/ui/json/button.h
  │   │ └─    1.3 ms - platforms/shared/ui/json/ui_internal.h
  │   │   └─    0.5 ms - fl/stl/memory.h
  │   ├─    1.2 ms - platforms/shared/ui/json/description.h
  │   ├─    1.2 ms - platforms/shared/ui/json/number_field.h
  │   └─    1.2 ms - platforms/shared/ui/json/help.h
  └─   10.2 ms - fl/asset.h
    └─    9.0 ms - fl/stl/url.h
fl/stl/stdint.h (78.7ms)
  └─   78.4 ms - platforms/int.h
    └─   77.9 ms - platforms/shared/int.h
      └─   77.8 ms - platforms/shared/int_linux.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1652.1 ms - Source: FastLED.h
  2.  1652.1 ms - Total Source: 
  3.   790.1 ms - Source: fl/task/executor.h
  4.   740.6 ms - Total ParseClass: 
  5.   512.4 ms - Source: fl/fastled.h
  6.   419.4 ms - Source: fl/task/scheduler.h
  7.   408.8 ms - Source: fl/stl/singleton.h
  8.   408.0 ms - Source: fl/stl/thread_local.h
  9.   406.7 ms - Source: fl/stl/thread.h
 10.   406.6 ms - Source: platforms/thread.h
 11.   406.6 ms - Source: platforms/stub/thread_stub.h
 12.   406.5 ms - Source: platforms/stub/thread_stub_stl.h
 13.   400.9 ms - Source: thread
 14.   355.8 ms - Source: fl/task/promise.h
 15.   304.4 ms - Source: crgb.h
 16.   303.0 ms - Source: fl/gfx/crgb.h
 17.   302.1 ms - Source: fl/stl/function.h
 18.   297.7 ms - Source: fl/math/ease.h
 19.   295.1 ms - Source: fl/math/fixed_point.h
 20.   237.0 ms - Total InstantiateFunction: 

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1652.1ms)
    - fl/task/executor.h (790.1ms)
    - fl/fastled.h (512.4ms)
    - fl/task/scheduler.h (419.4ms)
    - fl/stl/singleton.h (408.8ms)
    - fl/stl/thread_local.h (408.0ms)
    - fl/stl/thread.h (406.7ms)
    - platforms/thread.h (406.6ms)
    - platforms/stub/thread_stub.h (406.6ms)
    - platforms/stub/thread_stub_stl.h (406.5ms)

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

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1652.1ms)
2. Consider optimizing fl/task/executor.h (790.1ms)
3. Consider optimizing fl/fastled.h (512.4ms)

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/fl/power_estimation.cpp (1)

26-31: ⚠️ Potential issue | 🟡 Minor

Reset the exponent after the fixture test as well.

Line 200 leaves the FastLED singleton with a non-linear exponent after this test finishes. The constructor reset protects tests before they run, but not later tests in the same process.

Proposed fix
 struct PowerEstimationFixture {
     PowerEstimationFixture() {
         // Reset power model to WS2812 @ 5V default (80, 55, 75, 5)
         set_power_model(PowerModelRGB());
         set_power_scaling_exponent(1.0f);
     }
+
+    ~PowerEstimationFixture() {
+        set_power_scaling_exponent(1.0f);
+    }
 };

Also applies to: 200-201

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/fl/power_estimation.cpp` around lines 26 - 31, The fixture resets the
power model/exponent in the constructor but never restores the exponent after
tests, leaving FastLED with a non-linear exponent; add a destructor for
PowerEstimationFixture that restores the global state by calling
set_power_scaling_exponent(1.0f) (and optionally
set_power_model(PowerModelRGB()) if you want to fully revert) so the exponent is
reset when the fixture goes out of scope; implement ~PowerEstimationFixture() {
set_power_scaling_exponent(1.0f); } in the same struct to ensure later tests run
with the default exponent.
🧹 Nitpick comments (1)
tests/power_mgt.cpp (1)

12-20: Restore the previous exponent in the scoped helper.

ScopedPowerScalingExponent currently resets to 1.0f unconditionally. Capturing the previous value keeps the helper safe for nested scopes or future tests with non-linear baselines.

Proposed refactor
 struct ScopedPowerScalingExponent {
-    explicit ScopedPowerScalingExponent(float exponent) {
+    explicit ScopedPowerScalingExponent(float exponent)
+        : previous_exponent(get_power_scaling_exponent()) {
         set_power_scaling_exponent(exponent);
     }
 
     ~ScopedPowerScalingExponent() {
-        set_power_scaling_exponent(1.0f);
+        set_power_scaling_exponent(previous_exponent);
     }
+
+    float previous_exponent;
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/power_mgt.cpp` around lines 12 - 20, ScopedPowerScalingExponent resets
the exponent unconditionally to 1.0f in its destructor; change it to capture the
current exponent on construction and restore that stored value on destruction.
Add a private float member (e.g., previous_exponent_) in struct
ScopedPowerScalingExponent, set previous_exponent_ =
get_power_scaling_exponent() in the constructor before calling
set_power_scaling_exponent(exponent), and in ~ScopedPowerScalingExponent() call
set_power_scaling_exponent(previous_exponent_); if get_power_scaling_exponent()
doesn't exist, add or use the appropriate accessor to read the current exponent
so nested scopes restore correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/power_mgt.cpp.hpp`:
- Around line 250-256: The reverse LUT is built too optimistically by choosing
the first source with state.forward[source] >= scaled; instead build a
conservative floor inverse so reverse[scaled] maps to the largest source whose
forward value is <= scaled (never exceed the scaled target). Change the loop
that sets state.reverse to advance source while source+1 < 256 and
state.forward[source+1] <= scaled, then assign state.reverse[scaled] =
static_cast<fl::u8>(source); this uses state.forward and state.reverse to
produce a safe floor inverse (affecting the limiter and unmap_power_value
paths).

---

Outside diff comments:
In `@tests/fl/power_estimation.cpp`:
- Around line 26-31: The fixture resets the power model/exponent in the
constructor but never restores the exponent after tests, leaving FastLED with a
non-linear exponent; add a destructor for PowerEstimationFixture that restores
the global state by calling set_power_scaling_exponent(1.0f) (and optionally
set_power_model(PowerModelRGB()) if you want to fully revert) so the exponent is
reset when the fixture goes out of scope; implement ~PowerEstimationFixture() {
set_power_scaling_exponent(1.0f); } in the same struct to ensure later tests run
with the default exponent.

---

Nitpick comments:
In `@tests/power_mgt.cpp`:
- Around line 12-20: ScopedPowerScalingExponent resets the exponent
unconditionally to 1.0f in its destructor; change it to capture the current
exponent on construction and restore that stored value on destruction. Add a
private float member (e.g., previous_exponent_) in struct
ScopedPowerScalingExponent, set previous_exponent_ =
get_power_scaling_exponent() in the constructor before calling
set_power_scaling_exponent(exponent), and in ~ScopedPowerScalingExponent() call
set_power_scaling_exponent(previous_exponent_); if get_power_scaling_exponent()
doesn't exist, add or use the appropriate accessor to read the current exponent
so nested scopes restore correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7a2bb39d-4d4a-4f83-bbdb-b3f810f4f066

📥 Commits

Reviewing files that changed from the base of the PR and between eee316d and d1459c5.

📒 Files selected for processing (6)
  • src/FastLED.cpp.hpp
  • src/FastLED.h
  • src/power_mgt.cpp.hpp
  • src/power_mgt.h
  • tests/fl/power_estimation.cpp
  • tests/power_mgt.cpp

Comment thread src/power_mgt.cpp.hpp Outdated
@zackees
Copy link
Copy Markdown
Member Author

zackees commented Apr 20, 2026

Follow-up cleanup pushed:

  • the non-linear power-scaling path is now explicitly gated on SKETCH_HAS_LARGE_MEMORY
  • low-memory / legacy targets keep the old linear behavior automatically
  • on those targets, setPowerScalingExponent() is intentionally a no-op and getPowerScalingExponent() reports 1.0f
  • the large-memory path keeps the newer table-backed implementation

This matches the repo's existing memory-tier convention more closely than enabling the new path everywhere.

@github-actions
Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 982.05ms

Top 5 Slowest Headers

  1. FastLED.h - 743.96ms
  2. fl/fastled.h - 315.22ms
  3. fl/task/executor.h - 240.07ms
  4. crgb.h - 174.66ms
  5. fl/gfx/crgb.h - 173.33ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (744.0ms)
⚠️ Header fl/fastled.h exceeds 150ms (315.2ms)
⚠️ Header fl/task/executor.h exceeds 150ms (240.1ms)
⚠️ Header crgb.h exceeds 150ms (174.7ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (173.3ms)
⚠️ Header fl/math/ease.h exceeds 150ms (168.9ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (167.0ms)
⚠️ Header fl/task/scheduler.h exceeds 50ms (125.9ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (117.3ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (116.6ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (115.6ms)
⚠️ Header platforms/thread.h exceeds 50ms (115.4ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (115.4ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (115.3ms)
⚠️ Header fl/ui.h exceeds 50ms (105.5ms)
⚠️ Header fl/task/promise.h exceeds 50ms (102.1ms)
⚠️ Header fl/stl/json.h exceeds 50ms (65.0ms)
⚠️ Header fl/stl/function.h exceeds 50ms (60.6ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (51.0ms)
⚠️ Template instantiation time is high (51.2%)

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

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    2,127.84 ms
Frontend Time:             14.63 ms (0.7%)
Backend Time:              472.77 ms (22.2%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    11157.25 ms (524.3%)
Templates                   547.63 ms ( 25.7%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1313.2 ms - FastLED.h (SLOW)
   682.2 ms - fl/task/executor.h (SLOW)
   426.1 ms - fl/fastled.h (SLOW)
   377.2 ms - fl/task/scheduler.h (SLOW)
   368.4 ms - fl/stl/singleton.h (SLOW)
   367.8 ms - fl/stl/thread_local.h (SLOW)
   366.7 ms - fl/stl/thread.h (SLOW)
   366.6 ms - platforms/thread.h (SLOW)
   366.6 ms - platforms/stub/thread_stub.h (SLOW)
   366.5 ms - platforms/stub/thread_stub_stl.h (SLOW)
   292.7 ms - fl/task/promise.h (SLOW)
   250.8 ms - fl/stl/function.h (SLOW)
   245.7 ms - crgb.h (SLOW)
   244.4 ms - fl/gfx/crgb.h (SLOW)
   240.1 ms - fl/math/ease.h (SLOW)
   238.3 ms - fl/math/fixed_point.h (SLOW)
   117.7 ms - fl/math/fixed_point/s4x12.h (SLOW)
   109.5 ms - fl/stl/vector.h (SLOW)
   107.4 ms - fl/ui.h (SLOW)
   100.7 ms - fl/math/sin32.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1313.2ms)
  ├─  682.2 ms - fl/task/executor.h
  │ ├─  377.2 ms - fl/task/scheduler.h
  │ │ ├─  368.4 ms - fl/stl/singleton.h
  │ │ │ └─  367.8 ms - fl/stl/thread_local.h
  │ │ │   └─  366.7 ms - fl/stl/thread.h
  │ │ │     └─  366.6 ms - platforms/thread.h
  │ │ │       └─  366.6 ms - platforms/stub/thread_stub.h
  │ │ │         └─  366.5 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  360.3 ms - thread
  │ │ │             ├─  196.2 ms - std_thread.h
  │ │ │             └─  137.5 ms - this_thread_sleep.h
  │ │ └─    8.0 ms - fl/task/task.h
  │ │   └─    3.2 ms - fl/trace.h
  │ │     ├─    2.1 ms - fl/stl/chrono.h
  │ │     └─    0.8 ms - fl/stl/tuple.h
  │ ├─  292.7 ms - fl/task/promise.h
  │ │ ├─  250.8 ms - fl/stl/function.h
  │ │ │ ├─  109.5 ms - fl/stl/vector.h
  │ │ │ │ ├─   66.4 ms - fl/math/math.h
  │ │ │ │ │ └─   62.0 ms - fl/stl/undef.h
  │ │ │ │ │   └─   97.4 ms - stdlib.h
  │ │ │ │ │     ├─   49.4 ms - cstdlib
  │ │ │ │ │     │ └─   97.4 ms - stdlib.h
  │ │ │ │ │     │   ├─   49.4 ms - cstdlib
  │ │ │ │ │     │   └─    7.7 ms - types.h
  │ │ │ │ │     └─    7.7 ms - types.h
  │ │ │ │ │       ├─    7.7 ms - types.h
  │ │ │ │ │       │ ├─    7.7 ms - types.h
  │ │ │ │ │       │ ├─    1.4 ms - pthreadtypes.h
  │ │ │ │ │       │ ├─    1.3 ms - select.h
  │ │ │ │ │       │ └─    1.3 ms - endian.h
  │ │ │ │ │       ├─    1.4 ms - pthreadtypes.h
  │ │ │ │ │       │ └─    1.1 ms - thread-shared-types.h
  │ │ │ │ │       ├─    1.3 ms - select.h
  │ │ │ │ │       └─    1.3 ms - endian.h
  │ │ │ │ ├─   18.6 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─   15.3 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   10.4 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    6.8 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    1.8 ms - fl/stl/unique_ptr.h
  │ │ │ │ ├─    2.4 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ │ ├─   89.4 ms - fl/stl/variant.h
  │ │ │ │ └─   87.8 ms - fl/stl/new.h
  │ │ │ │   └─   87.8 ms - platforms/new.h
  │ │ │ │     └─   87.7 ms - platforms/shared/new.h
  │ │ │ │       └─   69.5 ms - new
  │ │ │ │         ├─   26.6 ms - c++config.h
  │ │ │ │         │ └─    3.4 ms - os_defines.h
  │ │ │ │         └─    0.5 ms - version.h
  │ │ │ ├─   38.3 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   25.9 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   20.9 ms - fl/stl/move.h
  │ │ │ │ ├─    8.1 ms - fl/stl/atomic.h
  │ │ │ │ │ └─    7.3 ms - platforms/atomic.h
  │ │ │ │ │   └─    7.3 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ │ ├─    5.1 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.1 ms - fl/stl/string.h
  │ │   ├─   11.0 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.2 ms - platforms/await.h
  │ │ └─    9.8 ms - platforms/coroutine_runtime.h
  │ │   └─    8.3 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
  ├─  426.1 ms - fl/fastled.h
  │ ├─  245.7 ms - crgb.h
  │ │ ├─  244.4 ms - fl/gfx/crgb.h
  │ │ │ └─  240.1 ms - fl/math/ease.h
  │ │ │   └─  238.3 ms - fl/math/fixed_point.h
  │ │ │     ├─  117.7 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─  100.7 ms - fl/math/sin32.h
  │ │ │     │ │ └─   98.1 ms - fl/math/simd.h
  │ │ │     │ │   └─   97.6 ms - fl/math/simd/types.h
  │ │ │     │ │     └─   97.3 ms - platforms/simd.h
  │ │ │     │ ├─    0.8 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.7 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   15.1 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   14.9 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   14.8 ms - fl/math/fixed_point/s16x16.h
  │ │ │     └─   14.7 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.8 ms - chsv.h
  │ │   └─    0.7 ms - fl/gfx/hsv.h
  │ ├─   87.2 ms - platforms.h
  │ │ └─   87.2 ms - platforms/stub/fastled_stub.h
  │ │   ├─   54.4 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   54.4 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   48.6 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   46.6 ms - fl/id_tracker.h
  │ │   │   │   └─   45.7 ms - fl/stl/mutex.h
  │ │   │   │     └─   45.6 ms - platforms/mutex.h
  │ │   │   │       └─   45.5 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.4 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   32.7 ms - platforms/stub/clockless_stub.h
  │ │     └─   32.6 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   11.5 ms - fl/channels/data.h
  │ │       │ └─    8.5 ms - fl/channels/config.h
  │ │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.1 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.4 ms - fl/chipsets/spi.h
  │ │       ├─   11.2 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.0 ms - fl/channels/driver.h
  │ ├─   35.1 ms - colorutils.h
  │ │ └─   34.3 ms - fl/gfx/colorutils.h
  │ │   ├─    7.7 ms - fl/gfx/blur.h
  │ │   │ └─    4.2 ms - fl/gfx/canvas.h
  │ │   │   └─    2.6 ms - fl/math/alpha.h
  │ │   └─    2.7 ms - fl/gfx/fill.h
  │ ├─   20.5 ms - pixel_controller.h
  │ │ ├─   14.5 ms - pixel_iterator.h
  │ │ │ └─   14.4 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    4.0 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    4.0 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    3.1 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    2.5 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.5 ms - rgbw.h
  │ │   └─    2.3 ms - fl/gfx/rgbw.h
  │ └─   18.5 ms - pixeltypes.h
  │   ├─   15.3 ms - lib8tion.h
  │   │ ├─    7.7 ms - fl/math/math8.h
  │   │ │ ├─    3.9 ms - fl/math/intmap.h
  │   │ │ │ └─    3.1 ms - platforms/intmap.h
  │   │ │ ├─    2.1 ms - fl/math/scale8.h
  │   │ │ │ └─    2.0 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.8 ms - platforms/trig8.h
  │   │       └─    0.7 ms - platforms/shared/trig8.h
  │   └─    2.8 ms - crgb.hpp
  ├─  107.4 ms - fl/ui.h
  │ ├─   65.8 ms - fl/stl/json.h
  │ │ └─   51.7 ms - fl/stl/json/types.h
  │ │   └─    6.2 ms - fl/stl/limits.h
  │ ├─    9.8 ms - fl/ui_impl.h
  │ │ └─    9.3 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.6 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.7 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/description.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/help.h
  │ │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  │ └─    8.1 ms - fl/asset.h
  │   └─    7.1 ms - fl/stl/url.h
  ├─   25.0 ms - chipsets.h
  │ ├─   10.2 ms - fl/chipsets/ucs7604.h
  │ │ └─    7.6 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    6.0 ms - fl/chipsets/apa102.h
  │ ├─    1.6 ms - fl/chipsets/lpd880x.h
  │ ├─    0.7 ms - fl/chipsets/ws2801.h
  │ └─    0.7 ms - fl/chipsets/p9813.h
  └─   20.7 ms - fl/audio/audio_processor.h
    ├─    5.2 ms - fl/audio/audio_context.h
    │ └─    1.5 ms - fl/audio/fft/fft.h
    ├─    2.0 ms - fl/audio/detector/vibe.h
    └─    0.8 ms - fl/audio/signal_conditioner.h
fl/task/executor.h (682.2ms)
  ├─  377.2 ms - fl/task/scheduler.h
  │ ├─  368.4 ms - fl/stl/singleton.h
  │ │ └─  367.8 ms - fl/stl/thread_local.h
  │ │   └─  366.7 ms - fl/stl/thread.h
  │ │     └─  366.6 ms - platforms/thread.h
  │ │       └─  366.6 ms - platforms/stub/thread_stub.h
  │ │         └─  366.5 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  360.3 ms - thread
  │ │             ├─  196.2 ms - std_thread.h
  │ │             │ ├─   56.0 ms - tuple
  │ │             │ ├─   41.2 ms - refwrap.h
  │ │             │ ├─   37.5 ms - iosfwd
  │ │             │ ├─    8.7 ms - gthr.h
  │ │             │ └─    4.9 ms - unique_ptr.h
  │ │             └─  137.5 ms - this_thread_sleep.h
  │ │               ├─  121.9 ms - chrono.h
  │ │               └─    2.8 ms - cerrno
  │ └─    8.0 ms - fl/task/task.h
  │   └─    3.2 ms - fl/trace.h
  │     ├─    2.1 ms - fl/stl/chrono.h
  │     └─    0.8 ms - fl/stl/tuple.h
  ├─  292.7 ms - fl/task/promise.h
  │ ├─  250.8 ms - fl/stl/function.h
  │ │ ├─  109.5 ms - fl/stl/vector.h
  │ │ │ ├─   66.4 ms - fl/math/math.h
  │ │ │ │ └─   62.0 ms - fl/stl/undef.h
  │ │ │ │   └─   97.4 ms - stdlib.h
  │ │ │ │     ├─   49.4 ms - cstdlib
  │ │ │ │     │ └─   97.4 ms - stdlib.h
  │ │ │ │     │   ├─   49.4 ms - cstdlib
  │ │ │ │     │   │ └─   97.4 ms - stdlib.h
  │ │ │ │     │   └─    7.7 ms - types.h
  │ │ │ │     │     ├─    7.7 ms - types.h
  │ │ │ │     │     ├─    1.4 ms - pthreadtypes.h
  │ │ │ │     │     ├─    1.3 ms - select.h
  │ │ │ │     │     └─    1.3 ms - endian.h
  │ │ │ │     └─    7.7 ms - types.h
  │ │ │ │       ├─    7.7 ms - types.h
  │ │ │ │       │ ├─    7.7 ms - types.h
  │ │ │ │       │ │ ├─    7.7 ms - types.h
  │ │ │ │       │ │ ├─    1.4 ms - pthreadtypes.h
  │ │ │ │       │ │ ├─    1.3 ms - select.h
  │ │ │ │       │ │ └─    1.3 ms - endian.h
  │ │ │ │       │ ├─    1.4 ms - pthreadtypes.h
  │ │ │ │       │ │ └─    1.1 ms - thread-shared-types.h
  │ │ │ │       │ ├─    1.3 ms - select.h
  │ │ │ │       │ └─    1.3 ms - endian.h
  │ │ │ │       ├─    1.4 ms - pthreadtypes.h
  │ │ │ │       │ └─    1.1 ms - thread-shared-types.h
  │ │ │ │       ├─    1.3 ms - select.h
  │ │ │ │       └─    1.3 ms - endian.h
  │ │ │ ├─   18.6 ms - fl/stl/initializer_list.h
  │ │ │ ├─   15.3 ms - fl/stl/allocator.h
  │ │ │ │ └─   10.4 ms - fl/stl/bitset.h
  │ │ │ │   └─    6.8 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    1.8 ms - fl/stl/unique_ptr.h
  │ │ │ ├─    2.4 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ ├─   89.4 ms - fl/stl/variant.h
  │ │ │ └─   87.8 ms - fl/stl/new.h
  │ │ │   └─   87.8 ms - platforms/new.h
  │ │ │     └─   87.7 ms - platforms/shared/new.h
  │ │ │       └─   69.5 ms - new
  │ │ │         ├─   26.6 ms - c++config.h
  │ │ │         │ └─    3.4 ms - os_defines.h
  │ │ │         │   └─    2.9 ms - features.h
  │ │ │         └─    0.5 ms - version.h
  │ │ ├─   38.3 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   25.9 ms - fl/stl/type_traits.h
  │ │ │ │ └─   20.9 ms - fl/stl/move.h
  │ │ │ ├─    8.1 ms - fl/stl/atomic.h
  │ │ │ │ └─    7.3 ms - platforms/atomic.h
  │ │ │ │   └─    7.3 ms - platforms/shared/atomic.h
  │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ ├─    5.1 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.1 ms - fl/stl/string.h
  │   ├─   11.0 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.2 ms - platforms/await.h
  │ └─    9.8 ms - platforms/coroutine_runtime.h
  │   └─    8.3 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 (426.1ms)
  ├─  245.7 ms - crgb.h
  │ ├─  244.4 ms - fl/gfx/crgb.h
  │ │ └─  240.1 ms - fl/math/ease.h
  │ │   └─  238.3 ms - fl/math/fixed_point.h
  │ │     ├─  117.7 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─  100.7 ms - fl/math/sin32.h
  │ │     │ │ └─   98.1 ms - fl/math/simd.h
  │ │     │ │   └─   97.6 ms - fl/math/simd/types.h
  │ │     │ │     └─   97.3 ms - platforms/simd.h
  │ │     │ │       └─   97.2 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    0.8 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.7 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   15.1 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   14.9 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   14.8 ms - fl/math/fixed_point/s16x16.h
  │ │     └─   14.7 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.8 ms - chsv.h
  │   └─    0.7 ms - fl/gfx/hsv.h
  ├─   87.2 ms - platforms.h
  │ └─   87.2 ms - platforms/stub/fastled_stub.h
  │   ├─   54.4 ms - platforms/stub/fastspi_stub.h
  │   │ └─   54.4 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   48.6 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   46.6 ms - fl/id_tracker.h
  │   │   │   └─   45.7 ms - fl/stl/mutex.h
  │   │   │     └─   45.6 ms - platforms/mutex.h
  │   │   │       └─   45.5 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   45.5 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.4 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   32.7 ms - platforms/stub/clockless_stub.h
  │     └─   32.6 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   11.5 ms - fl/channels/data.h
  │       │ └─    8.5 ms - fl/channels/config.h
  │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.1 ms - fl/chipsets/led_timing.h
  │       │   └─    1.4 ms - fl/chipsets/spi.h
  │       ├─   11.2 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.0 ms - fl/channels/driver.h
  ├─   35.1 ms - colorutils.h
  │ └─   34.3 ms - fl/gfx/colorutils.h
  │   ├─    7.7 ms - fl/gfx/blur.h
  │   │ └─    4.2 ms - fl/gfx/canvas.h
  │   │   └─    2.6 ms - fl/math/alpha.h
  │   └─    2.7 ms - fl/gfx/fill.h
  ├─   20.5 ms - pixel_controller.h
  │ ├─   14.5 ms - pixel_iterator.h
  │ │ └─   14.4 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    4.0 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    4.0 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    3.1 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    2.5 ms - fl/gfx/gamma_lut.h
  │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.5 ms - rgbw.h
  │   └─    2.3 ms - fl/gfx/rgbw.h
  └─   18.5 ms - pixeltypes.h
    ├─   15.3 ms - lib8tion.h
    │ ├─    7.7 ms - fl/math/math8.h
    │ │ ├─    3.9 ms - fl/math/intmap.h
    │ │ │ └─    3.1 ms - platforms/intmap.h
    │ │ ├─    2.1 ms - fl/math/scale8.h
    │ │ │ └─    2.0 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.8 ms - platforms/trig8.h
    │       └─    0.7 ms - platforms/shared/trig8.h
    └─    2.8 ms - crgb.hpp
fl/ui.h (107.4ms)
  ├─   65.8 ms - fl/stl/json.h
  │ └─   51.7 ms - fl/stl/json/types.h
  │   └─    6.2 ms - fl/stl/limits.h
  ├─    9.8 ms - fl/ui_impl.h
  │ └─    9.3 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.6 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.7 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    0.9 ms - platforms/shared/ui/json/description.h
  │   ├─    0.8 ms - platforms/shared/ui/json/help.h
  │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  └─    8.1 ms - fl/asset.h
    └─    7.1 ms - fl/stl/url.h
chipsets.h (25.0ms)
  ├─   10.2 ms - fl/chipsets/ucs7604.h
  │ └─    7.6 ms - fl/chipsets/encoders/ucs7604.h
  ├─    6.0 ms - fl/chipsets/apa102.h
  ├─    1.6 ms - fl/chipsets/lpd880x.h
  ├─    0.7 ms - fl/chipsets/ws2801.h
  └─    0.7 ms - fl/chipsets/p9813.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1313.2 ms - Source: FastLED.h
  2.  1313.2 ms - Total Source: 
  3.   682.2 ms - Source: fl/task/executor.h
  4.   552.1 ms - Total ParseClass: 
  5.   426.1 ms - Source: fl/fastled.h
  6.   377.2 ms - Source: fl/task/scheduler.h
  7.   368.4 ms - Source: fl/stl/singleton.h
  8.   367.8 ms - Source: fl/stl/thread_local.h
  9.   366.7 ms - Source: fl/stl/thread.h
 10.   366.6 ms - Source: platforms/thread.h
 11.   366.6 ms - Source: platforms/stub/thread_stub.h
 12.   366.5 ms - Source: platforms/stub/thread_stub_stl.h
 13.   360.3 ms - Source: thread
 14.   292.7 ms - Source: fl/task/promise.h
 15.   250.8 ms - Source: fl/stl/function.h
 16.   245.7 ms - Source: crgb.h
 17.   244.4 ms - Source: fl/gfx/crgb.h
 18.   240.1 ms - Source: fl/math/ease.h
 19.   238.3 ms - Source: fl/math/fixed_point.h
 20.   201.1 ms - Total InstantiateFunction: 

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1313.2ms)
    - fl/task/executor.h (682.2ms)
    - fl/fastled.h (426.1ms)
    - fl/task/scheduler.h (377.2ms)
    - fl/stl/singleton.h (368.4ms)
    - fl/stl/thread_local.h (367.8ms)
    - fl/stl/thread.h (366.7ms)
    - platforms/thread.h (366.6ms)
    - platforms/stub/thread_stub.h (366.6ms)
    - platforms/stub/thread_stub_stl.h (366.5ms)

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

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1313.2ms)
2. Consider optimizing fl/task/executor.h (682.2ms)
3. Consider optimizing fl/fastled.h (426.1ms)

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

@zackees zackees force-pushed the powertweaks-modern branch from c686306 to 82111e8 Compare April 20, 2026 21:34
@github-actions
Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 1186.59ms

Top 5 Slowest Headers

  1. FastLED.h - 907.60ms
  2. fl/fastled.h - 390.03ms
  3. fl/task/executor.h - 297.27ms
  4. crgb.h - 222.51ms
  5. fl/gfx/crgb.h - 221.23ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (907.6ms)
⚠️ Header fl/fastled.h exceeds 150ms (390.0ms)
⚠️ Header fl/task/executor.h exceeds 150ms (297.3ms)
⚠️ Header crgb.h exceeds 150ms (222.5ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (221.2ms)
⚠️ Header fl/math/ease.h exceeds 150ms (216.3ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (213.7ms)
⚠️ Header fl/task/scheduler.h exceeds 150ms (154.0ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (144.2ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (143.5ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (142.4ms)
⚠️ Header platforms/thread.h exceeds 50ms (142.3ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (142.2ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (142.2ms)
⚠️ Header fl/task/promise.h exceeds 50ms (129.5ms)
⚠️ Header fl/ui.h exceeds 50ms (123.7ms)
⚠️ Header fl/stl/function.h exceeds 50ms (79.5ms)
⚠️ Header fl/stl/json.h exceeds 50ms (77.6ms)
⚠️ Header fl/math/fixed_point/s4x12.h exceeds 50ms (64.5ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (60.2ms)
⚠️ Header platforms.h exceeds 50ms (56.2ms)
⚠️ Header platforms/stub/fastled_stub.h exceeds 50ms (56.1ms)
⚠️ Header fl/stl/vector.h exceeds 50ms (50.5ms)
⚠️ Template instantiation time is high (52.2%)

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

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    2,318.17 ms
Frontend Time:             17.69 ms (0.8%)
Backend Time:              234.94 ms (10.1%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    15218.37 ms (656.5%)
Templates                   619.00 ms ( 26.7%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1740.7 ms - FastLED.h (SLOW)
   943.2 ms - fl/task/executor.h (SLOW)
   568.9 ms - fl/fastled.h (SLOW)
   504.0 ms - fl/task/scheduler.h (SLOW)
   494.3 ms - fl/stl/singleton.h (SLOW)
   493.6 ms - fl/stl/thread_local.h (SLOW)
   492.5 ms - fl/stl/thread.h (SLOW)
   492.4 ms - platforms/thread.h (SLOW)
   492.3 ms - platforms/stub/thread_stub.h (SLOW)
   492.3 ms - platforms/stub/thread_stub_stl.h (SLOW)
   425.4 ms - fl/task/promise.h (SLOW)
   375.3 ms - fl/stl/function.h (SLOW)
   355.8 ms - crgb.h (SLOW)
   354.4 ms - fl/gfx/crgb.h (SLOW)
   349.4 ms - fl/math/ease.h (SLOW)
   346.9 ms - fl/math/fixed_point.h (SLOW)
   197.7 ms - fl/math/fixed_point/s4x12.h (SLOW)
   195.7 ms - fl/stl/vector.h (SLOW)
   176.8 ms - fl/math/sin32.h (SLOW)
   173.6 ms - fl/math/simd.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1740.7ms)
  ├─  943.2 ms - fl/task/executor.h
  │ ├─  504.0 ms - fl/task/scheduler.h
  │ │ ├─  494.3 ms - fl/stl/singleton.h
  │ │ │ └─  493.6 ms - fl/stl/thread_local.h
  │ │ │   └─  492.5 ms - fl/stl/thread.h
  │ │ │     └─  492.4 ms - platforms/thread.h
  │ │ │       └─  492.3 ms - platforms/stub/thread_stub.h
  │ │ │         └─  492.3 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  469.8 ms - thread
  │ │ │             ├─  285.1 ms - std_thread.h
  │ │ │             └─  145.3 ms - this_thread_sleep.h
  │ │ └─    8.8 ms - fl/task/task.h
  │ │   └─    3.6 ms - fl/trace.h
  │ │     ├─    2.3 ms - fl/stl/chrono.h
  │ │     └─    1.0 ms - fl/stl/tuple.h
  │ ├─  425.4 ms - fl/task/promise.h
  │ │ ├─  375.3 ms - fl/stl/function.h
  │ │ │ ├─  195.7 ms - fl/stl/vector.h
  │ │ │ │ ├─  147.2 ms - fl/math/math.h
  │ │ │ │ │ └─  141.3 ms - fl/stl/undef.h
  │ │ │ │ │   └─  196.9 ms - stdlib.h
  │ │ │ │ │     ├─   91.5 ms - cstdlib
  │ │ │ │ │     │ └─  196.9 ms - stdlib.h
  │ │ │ │ │     │   ├─   91.5 ms - cstdlib
  │ │ │ │ │     │   ├─   12.6 ms - types.h
  │ │ │ │ │     │   └─    0.6 ms - floatn.h
  │ │ │ │ │     ├─   12.6 ms - types.h
  │ │ │ │ │     │ ├─   12.6 ms - types.h
  │ │ │ │ │     │ │ ├─   12.6 ms - types.h
  │ │ │ │ │     │ │ ├─    3.2 ms - select.h
  │ │ │ │ │     │ │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │ │     │ │ └─    2.0 ms - endian.h
  │ │ │ │ │     │ ├─    3.2 ms - select.h
  │ │ │ │ │     │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │ │     │ │ └─    1.8 ms - thread-shared-types.h
  │ │ │ │ │     │ └─    2.0 ms - endian.h
  │ │ │ │ │     └─    0.6 ms - floatn.h
  │ │ │ │ ├─   19.2 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   13.1 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    8.4 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    2.2 ms - fl/stl/unique_ptr.h
  │ │ │ │ ├─   18.0 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.9 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.8 ms - fl/stl/functional.h
  │ │ │ ├─  102.5 ms - fl/stl/variant.h
  │ │ │ │ └─  100.6 ms - fl/stl/new.h
  │ │ │ │   └─  100.5 ms - platforms/new.h
  │ │ │ │     └─  100.5 ms - platforms/shared/new.h
  │ │ │ │       └─   86.5 ms - new
  │ │ │ │         ├─   35.6 ms - c++config.h
  │ │ │ │         │ └─    5.4 ms - os_defines.h
  │ │ │ │         └─    0.7 ms - version.h
  │ │ │ ├─   60.0 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   33.7 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   27.0 ms - fl/stl/move.h
  │ │ │ │ ├─   21.3 ms - fl/stl/atomic.h
  │ │ │ │ │ └─   20.2 ms - platforms/atomic.h
  │ │ │ │ │   └─   20.2 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ │ ├─    6.5 ms - fl/stl/compiler_control.h
  │ │ │ └─    4.8 ms - fl/stl/algorithm.h
  │ │ │   └─    2.0 ms - fl/math/random.h
  │ │ │     └─    0.9 ms - fl/math/random8.h
  │ │ └─   44.8 ms - fl/stl/string.h
  │ │   ├─   13.0 ms - fl/stl/basic_string.h
  │ │   │ ├─    1.1 ms - fl/stl/not_null.h
  │ │   │ ├─    0.9 ms - fl/stl/iterator.h
  │ │   │ └─    0.5 ms - fl/stl/charconv.h
  │ │   ├─    9.0 ms - fl/stl/span.h
  │ │   │ └─    3.5 ms - fl/math/geometry.h
  │ │   ├─    5.8 ms - fl/stl/string_view.h
  │ │   └─    1.5 ms - fl/stl/optional.h
  │ ├─   11.6 ms - platforms/await.h
  │ │ └─   11.2 ms - platforms/coroutine_runtime.h
  │ │   └─    9.6 ms - fl/system/engine_events.h
  │ │     ├─    4.9 ms - fl/math/screenmap.h
  │ │     │ └─    3.7 ms - fl/stl/flat_map.h
  │ │     └─    3.1 ms - fl/math/xymap.h
  │ │       └─    0.8 ms - fl/math/lut.h
  │ └─    0.8 ms - fl/task/promise_result.h
  ├─  568.9 ms - fl/fastled.h
  │ ├─  355.8 ms - crgb.h
  │ │ ├─  354.4 ms - fl/gfx/crgb.h
  │ │ │ └─  349.4 ms - fl/math/ease.h
  │ │ │   └─  346.9 ms - fl/math/fixed_point.h
  │ │ │     ├─  197.7 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─  176.8 ms - fl/math/sin32.h
  │ │ │     │ │ └─  173.6 ms - fl/math/simd.h
  │ │ │     │ │   └─  173.0 ms - fl/math/simd/types.h
  │ │ │     │ │     └─  172.7 ms - platforms/simd.h
  │ │ │     │ ├─    1.0 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.8 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   19.0 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   18.8 ms - fl/math/fixed_point/s16x16.h
  │ │ │     ├─   18.8 ms - fl/math/fixed_point/s8x24.h
  │ │ │     └─   18.5 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.9 ms - chsv.h
  │ │   └─    0.8 ms - fl/gfx/hsv.h
  │ ├─  102.0 ms - platforms.h
  │ │ └─  101.9 ms - platforms/stub/fastled_stub.h
  │ │   ├─   64.6 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   64.6 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   58.2 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   56.0 ms - fl/id_tracker.h
  │ │   │   │   └─   55.1 ms - fl/stl/mutex.h
  │ │   │   │     └─   55.0 ms - platforms/mutex.h
  │ │   │   │       └─   54.9 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    6.0 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   37.2 ms - platforms/stub/clockless_stub.h
  │ │     └─   37.2 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   13.3 ms - fl/system/log.h
  │ │       │ └─   12.9 ms - fl/stl/strstream.h
  │ │       ├─   13.1 ms - fl/channels/data.h
  │ │       │ └─    9.8 ms - fl/channels/config.h
  │ │       │   ├─    2.1 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.4 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.8 ms - fl/chipsets/spi.h
  │ │       ├─    2.4 ms - fl/channels/manager.h
  │ │       ├─    1.6 ms - fl/stl/weak_ptr.h
  │ │       └─    1.1 ms - fl/channels/driver.h
  │ ├─   42.2 ms - colorutils.h
  │ │ └─   41.5 ms - fl/gfx/colorutils.h
  │ │   ├─    8.9 ms - fl/gfx/blur.h
  │ │   │ └─    4.7 ms - fl/gfx/canvas.h
  │ │   │   └─    2.9 ms - fl/math/alpha.h
  │ │   └─    3.2 ms - fl/gfx/fill.h
  │ ├─   24.0 ms - pixel_controller.h
  │ │ ├─   17.2 ms - pixel_iterator.h
  │ │ │ └─   17.1 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.2 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    4.5 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    1.1 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.9 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.7 ms - rgbw.h
  │ │   └─    2.4 ms - fl/gfx/rgbw.h
  │ └─   23.1 ms - pixeltypes.h
  │   ├─   19.4 ms - lib8tion.h
  │   │ ├─   10.0 ms - fl/math/math8.h
  │   │ │ ├─    5.3 ms - fl/math/intmap.h
  │   │ │ │ └─    4.2 ms - platforms/intmap.h
  │   │ │ ├─    2.5 ms - fl/math/scale8.h
  │   │ │ │ └─    2.4 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.1 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.3 ms - crgb.hpp
  ├─  123.3 ms - fl/ui.h
  │ ├─   77.3 ms - fl/stl/json.h
  │ │ └─   59.7 ms - fl/stl/json/types.h
  │ │   └─    7.6 ms - fl/stl/limits.h
  │ ├─   10.4 ms - fl/ui_impl.h
  │ │ └─    9.8 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.6 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.7 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/help.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/number_field.h
  │ │   └─    0.8 ms - platforms/shared/ui/json/description.h
  │ └─    9.6 ms - fl/asset.h
  │   └─    8.4 ms - fl/stl/url.h
  ├─   28.5 ms - chipsets.h
  │ ├─   11.5 ms - fl/chipsets/ucs7604.h
  │ │ └─    8.5 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    6.8 ms - fl/chipsets/apa102.h
  │ ├─    1.7 ms - fl/chipsets/lpd880x.h
  │ ├─    0.8 ms - fl/chipsets/p9813.h
  │ └─    0.8 ms - fl/chipsets/ws2801.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.1 ms - fl/audio/detector/vibe.h
    └─    1.0 ms - fl/audio/signal_conditioner.h
fl/task/executor.h (943.2ms)
  ├─  504.0 ms - fl/task/scheduler.h
  │ ├─  494.3 ms - fl/stl/singleton.h
  │ │ └─  493.6 ms - fl/stl/thread_local.h
  │ │   └─  492.5 ms - fl/stl/thread.h
  │ │     └─  492.4 ms - platforms/thread.h
  │ │       └─  492.3 ms - platforms/stub/thread_stub.h
  │ │         └─  492.3 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  469.8 ms - thread
  │ │             ├─  285.1 ms - std_thread.h
  │ │             │ ├─   86.1 ms - tuple
  │ │             │ ├─   47.4 ms - iosfwd
  │ │             │ ├─   39.8 ms - refwrap.h
  │ │             │ ├─   11.7 ms - gthr.h
  │ │             │ └─    6.2 ms - unique_ptr.h
  │ │             └─  145.3 ms - this_thread_sleep.h
  │ │               ├─  124.8 ms - chrono.h
  │ │               └─    4.3 ms - cerrno
  │ └─    8.8 ms - fl/task/task.h
  │   └─    3.6 ms - fl/trace.h
  │     ├─    2.3 ms - fl/stl/chrono.h
  │     └─    1.0 ms - fl/stl/tuple.h
  ├─  425.4 ms - fl/task/promise.h
  │ ├─  375.3 ms - fl/stl/function.h
  │ │ ├─  195.7 ms - fl/stl/vector.h
  │ │ │ ├─  147.2 ms - fl/math/math.h
  │ │ │ │ └─  141.3 ms - fl/stl/undef.h
  │ │ │ │   └─  196.9 ms - stdlib.h
  │ │ │ │     ├─   91.5 ms - cstdlib
  │ │ │ │     │ └─  196.9 ms - stdlib.h
  │ │ │ │     │   ├─   91.5 ms - cstdlib
  │ │ │ │     │   │ └─  196.9 ms - stdlib.h
  │ │ │ │     │   ├─   12.6 ms - types.h
  │ │ │ │     │   │ ├─   12.6 ms - types.h
  │ │ │ │     │   │ ├─    3.2 ms - select.h
  │ │ │ │     │   │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │     │   │ └─    2.0 ms - endian.h
  │ │ │ │     │   └─    0.6 ms - floatn.h
  │ │ │ │     ├─   12.6 ms - types.h
  │ │ │ │     │ ├─   12.6 ms - types.h
  │ │ │ │     │ │ ├─   12.6 ms - types.h
  │ │ │ │     │ │ │ ├─   12.6 ms - types.h
  │ │ │ │     │ │ │ ├─    3.2 ms - select.h
  │ │ │ │     │ │ │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │     │ │ │ └─    2.0 ms - endian.h
  │ │ │ │     │ │ ├─    3.2 ms - select.h
  │ │ │ │     │ │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │     │ │ │ └─    1.8 ms - thread-shared-types.h
  │ │ │ │     │ │ └─    2.0 ms - endian.h
  │ │ │ │     │ ├─    3.2 ms - select.h
  │ │ │ │     │ ├─    2.4 ms - pthreadtypes.h
  │ │ │ │     │ │ └─    1.8 ms - thread-shared-types.h
  │ │ │ │     │ └─    2.0 ms - endian.h
  │ │ │ │     └─    0.6 ms - floatn.h
  │ │ │ ├─   19.2 ms - fl/stl/allocator.h
  │ │ │ │ └─   13.1 ms - fl/stl/bitset.h
  │ │ │ │   └─    8.4 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    2.2 ms - fl/stl/unique_ptr.h
  │ │ │ ├─   18.0 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.9 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.8 ms - fl/stl/functional.h
  │ │ ├─  102.5 ms - fl/stl/variant.h
  │ │ │ └─  100.6 ms - fl/stl/new.h
  │ │ │   └─  100.5 ms - platforms/new.h
  │ │ │     └─  100.5 ms - platforms/shared/new.h
  │ │ │       └─   86.5 ms - new
  │ │ │         ├─   35.6 ms - c++config.h
  │ │ │         │ └─    5.4 ms - os_defines.h
  │ │ │         │   └─    4.9 ms - features.h
  │ │ │         └─    0.7 ms - version.h
  │ │ ├─   60.0 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   33.7 ms - fl/stl/type_traits.h
  │ │ │ │ └─   27.0 ms - fl/stl/move.h
  │ │ │ ├─   21.3 ms - fl/stl/atomic.h
  │ │ │ │ └─   20.2 ms - platforms/atomic.h
  │ │ │ │   └─   20.2 ms - platforms/shared/atomic.h
  │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ ├─    6.5 ms - fl/stl/compiler_control.h
  │ │ └─    4.8 ms - fl/stl/algorithm.h
  │ │   └─    2.0 ms - fl/math/random.h
  │ │     └─    0.9 ms - fl/math/random8.h
  │ └─   44.8 ms - fl/stl/string.h
  │   ├─   13.0 ms - fl/stl/basic_string.h
  │   │ ├─    1.1 ms - fl/stl/not_null.h
  │   │ ├─    0.9 ms - fl/stl/iterator.h
  │   │ └─    0.5 ms - fl/stl/charconv.h
  │   ├─    9.0 ms - fl/stl/span.h
  │   │ └─    3.5 ms - fl/math/geometry.h
  │   ├─    5.8 ms - fl/stl/string_view.h
  │   └─    1.5 ms - fl/stl/optional.h
  ├─   11.6 ms - platforms/await.h
  │ └─   11.2 ms - platforms/coroutine_runtime.h
  │   └─    9.6 ms - fl/system/engine_events.h
  │     ├─    4.9 ms - fl/math/screenmap.h
  │     │ └─    3.7 ms - fl/stl/flat_map.h
  │     └─    3.1 ms - fl/math/xymap.h
  │       └─    0.8 ms - fl/math/lut.h
  └─    0.8 ms - fl/task/promise_result.h
fl/fastled.h (568.9ms)
  ├─  355.8 ms - crgb.h
  │ ├─  354.4 ms - fl/gfx/crgb.h
  │ │ └─  349.4 ms - fl/math/ease.h
  │ │   └─  346.9 ms - fl/math/fixed_point.h
  │ │     ├─  197.7 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─  176.8 ms - fl/math/sin32.h
  │ │     │ │ └─  173.6 ms - fl/math/simd.h
  │ │     │ │   └─  173.0 ms - fl/math/simd/types.h
  │ │     │ │     └─  172.7 ms - platforms/simd.h
  │ │     │ │       └─  172.7 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    1.0 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.8 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   19.0 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   18.8 ms - fl/math/fixed_point/s16x16.h
  │ │     ├─   18.8 ms - fl/math/fixed_point/s8x24.h
  │ │     └─   18.5 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.9 ms - chsv.h
  │   └─    0.8 ms - fl/gfx/hsv.h
  ├─  102.0 ms - platforms.h
  │ └─  101.9 ms - platforms/stub/fastled_stub.h
  │   ├─   64.6 ms - platforms/stub/fastspi_stub.h
  │   │ └─   64.6 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   58.2 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   56.0 ms - fl/id_tracker.h
  │   │   │   └─   55.1 ms - fl/stl/mutex.h
  │   │   │     └─   55.0 ms - platforms/mutex.h
  │   │   │       └─   54.9 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   54.9 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    6.0 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   37.2 ms - platforms/stub/clockless_stub.h
  │     └─   37.2 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   13.3 ms - fl/system/log.h
  │       │ └─   12.9 ms - fl/stl/strstream.h
  │       ├─   13.1 ms - fl/channels/data.h
  │       │ └─    9.8 ms - fl/channels/config.h
  │       │   ├─    2.1 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.4 ms - fl/chipsets/led_timing.h
  │       │   └─    1.8 ms - fl/chipsets/spi.h
  │       ├─    2.4 ms - fl/channels/manager.h
  │       ├─    1.6 ms - fl/stl/weak_ptr.h
  │       └─    1.1 ms - fl/channels/driver.h
  ├─   42.2 ms - colorutils.h
  │ └─   41.5 ms - fl/gfx/colorutils.h
  │   ├─    8.9 ms - fl/gfx/blur.h
  │   │ └─    4.7 ms - fl/gfx/canvas.h
  │   │   └─    2.9 ms - fl/math/alpha.h
  │   └─    3.2 ms - fl/gfx/fill.h
  ├─   24.0 ms - pixel_controller.h
  │ ├─   17.2 ms - pixel_iterator.h
  │ │ └─   17.1 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.2 ms - fl/gfx/gamma_lut.h
  │ │   ├─    4.5 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    1.1 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.9 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.7 ms - rgbw.h
  │   └─    2.4 ms - fl/gfx/rgbw.h
  └─   23.1 ms - pixeltypes.h
    ├─   19.4 ms - lib8tion.h
    │ ├─   10.0 ms - fl/math/math8.h
    │ │ ├─    5.3 ms - fl/math/intmap.h
    │ │ │ └─    4.2 ms - platforms/intmap.h
    │ │ ├─    2.5 ms - fl/math/scale8.h
    │ │ │ └─    2.4 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.1 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.3 ms - crgb.hpp
fl/ui.h (123.3ms)
  ├─   77.3 ms - fl/stl/json.h
  │ └─   59.7 ms - fl/stl/json/types.h
  │   └─    7.6 ms - fl/stl/limits.h
  ├─   10.4 ms - fl/ui_impl.h
  │ └─    9.8 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.6 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.7 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    0.9 ms - platforms/shared/ui/json/help.h
  │   ├─    0.8 ms - platforms/shared/ui/json/number_field.h
  │   └─    0.8 ms - platforms/shared/ui/json/description.h
  └─    9.6 ms - fl/asset.h
    └─    8.4 ms - fl/stl/url.h
chipsets.h (28.5ms)
  ├─   11.5 ms - fl/chipsets/ucs7604.h
  │ └─    8.5 ms - fl/chipsets/encoders/ucs7604.h
  ├─    6.8 ms - fl/chipsets/apa102.h
  ├─    1.7 ms - fl/chipsets/lpd880x.h
  ├─    0.8 ms - fl/chipsets/p9813.h
  └─    0.8 ms - fl/chipsets/ws2801.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1740.7 ms - Source: FastLED.h
  2.  1740.7 ms - Total Source: 
  3.   943.2 ms - Source: fl/task/executor.h
  4.   671.7 ms - Total ParseClass: 
  5.   568.9 ms - Source: fl/fastled.h
  6.   504.0 ms - Source: fl/task/scheduler.h
  7.   494.3 ms - Source: fl/stl/singleton.h
  8.   493.6 ms - Source: fl/stl/thread_local.h
  9.   492.5 ms - Source: fl/stl/thread.h
 10.   492.4 ms - Source: platforms/thread.h
 11.   492.3 ms - Source: platforms/stub/thread_stub.h
 12.   492.3 ms - Source: platforms/stub/thread_stub_stl.h
 13.   469.8 ms - Source: thread
 14.   425.4 ms - Source: fl/task/promise.h
 15.   375.3 ms - Source: fl/stl/function.h
 16.   355.8 ms - Source: crgb.h
 17.   354.4 ms - Source: fl/gfx/crgb.h
 18.   349.4 ms - Source: fl/math/ease.h
 19.   346.9 ms - Source: fl/math/fixed_point.h
 20.   285.1 ms - Source: std_thread.h

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1740.7ms)
    - fl/task/executor.h (943.2ms)
    - fl/fastled.h (568.9ms)
    - fl/task/scheduler.h (504.0ms)
    - fl/stl/singleton.h (494.3ms)
    - fl/stl/thread_local.h (493.6ms)
    - fl/stl/thread.h (492.5ms)
    - platforms/thread.h (492.4ms)
    - platforms/stub/thread_stub.h (492.3ms)
    - platforms/stub/thread_stub_stl.h (492.3ms)

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

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1740.7ms)
2. Consider optimizing fl/task/executor.h (943.2ms)
3. Consider optimizing fl/fastled.h (568.9ms)

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/FastLED.h (1)

1362-1375: Consider const-qualifying getPowerScalingExponent().

getEstimatedPowerInMilliWatts(...) at line 1435 is const, and if it ever needs to consult the configured exponent via this accessor it won't be able to. The setter/getter pair is stateless here (delegates to free functions), so marking the getter const is free and future-proof.

♻️ Proposed change
-	inline float getPowerScalingExponent() {
+	inline float getPowerScalingExponent() const {
 		return get_power_scaling_exponent();
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/FastLED.h` around lines 1362 - 1375, The getter getPowerScalingExponent()
should be const-qualified so const methods (e.g., getEstimatedPowerInMilliWatts)
can call it; update the member function signature of getPowerScalingExponent()
to be inline float getPowerScalingExponent() const and ensure it still returns
get_power_scaling_exponent(); leave setPowerScalingExponent(float) unchanged and
keep delegating to set_power_scaling_exponent(float).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/FastLED.h`:
- Around line 1362-1368: Update the documentation for setPowerScalingExponent
(and its wrapper set_power_scaling_exponent) to state that the exponent must be
> 0.0 and that values ≤ 0.0 are treated as invalid and will cause the
implementation to fall back to linear (1.0) behavior with identity tables; also
note that values very close to 1.0 are treated as linear for stability and will
likewise fallback to the identity mapping. Ensure the new note clarifies this
behavior applies only to power estimation/limiting and not rendered brightness,
matching the implementation's defensive checks.

---

Nitpick comments:
In `@src/FastLED.h`:
- Around line 1362-1375: The getter getPowerScalingExponent() should be
const-qualified so const methods (e.g., getEstimatedPowerInMilliWatts) can call
it; update the member function signature of getPowerScalingExponent() to be
inline float getPowerScalingExponent() const and ensure it still returns
get_power_scaling_exponent(); leave setPowerScalingExponent(float) unchanged and
keep delegating to set_power_scaling_exponent(float).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c72b0540-f8da-47b5-a923-97bb3f16da34

📥 Commits

Reviewing files that changed from the base of the PR and between c686306 and 82111e8.

📒 Files selected for processing (6)
  • src/FastLED.cpp.hpp
  • src/FastLED.h
  • src/power_mgt.cpp.hpp
  • src/power_mgt.h
  • tests/fl/power_estimation.cpp
  • tests/power_mgt.cpp
✅ Files skipped from review due to trivial changes (1)
  • tests/power_mgt.cpp
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/FastLED.cpp.hpp
  • tests/fl/power_estimation.cpp
  • src/power_mgt.h
  • src/power_mgt.cpp.hpp

Comment thread src/FastLED.h
@zackees zackees force-pushed the powertweaks-modern branch from 82111e8 to 34820bb Compare April 20, 2026 21:59
@github-actions
Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 1183.30ms

Top 5 Slowest Headers

  1. FastLED.h - 902.32ms
  2. fl/fastled.h - 386.15ms
  3. fl/task/executor.h - 289.33ms
  4. crgb.h - 219.87ms
  5. fl/gfx/crgb.h - 218.58ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (902.3ms)
⚠️ Header fl/fastled.h exceeds 150ms (386.1ms)
⚠️ Header fl/task/executor.h exceeds 150ms (289.3ms)
⚠️ Header crgb.h exceeds 150ms (219.9ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (218.6ms)
⚠️ Header fl/math/ease.h exceeds 150ms (213.6ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (211.2ms)
⚠️ Header fl/task/scheduler.h exceeds 150ms (151.6ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (142.0ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (141.3ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (140.2ms)
⚠️ Header platforms/thread.h exceeds 50ms (140.1ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (140.0ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (140.0ms)
⚠️ Header fl/ui.h exceeds 50ms (127.7ms)
⚠️ Header fl/task/promise.h exceeds 50ms (124.0ms)
⚠️ Header fl/stl/json.h exceeds 50ms (80.1ms)
⚠️ Header fl/stl/function.h exceeds 50ms (74.0ms)
⚠️ Header fl/math/fixed_point/s4x12.h exceeds 50ms (63.6ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (62.3ms)
⚠️ Header platforms.h exceeds 50ms (55.7ms)
⚠️ Header platforms/stub/fastled_stub.h exceeds 50ms (55.6ms)
⚠️ Template instantiation time is high (53.7%)

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

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    1,922.63 ms
Frontend Time:             17.85 ms (0.9%)
Backend Time:              194.22 ms (10.1%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    11375.49 ms (591.7%)
Templates                   625.04 ms ( 32.5%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1406.0 ms - FastLED.h (SLOW)
   663.1 ms - fl/task/executor.h (SLOW)
   473.5 ms - fl/fastled.h (SLOW)
   375.4 ms - fl/task/scheduler.h (SLOW)
   365.7 ms - fl/stl/singleton.h (SLOW)
   365.0 ms - fl/stl/thread_local.h (SLOW)
   363.8 ms - fl/stl/thread.h (SLOW)
   363.7 ms - platforms/thread.h (SLOW)
   363.7 ms - platforms/stub/thread_stub.h (SLOW)
   363.6 ms - platforms/stub/thread_stub_stl.h (SLOW)
   274.3 ms - crgb.h (SLOW)
   273.7 ms - fl/task/promise.h (SLOW)
   273.0 ms - fl/gfx/crgb.h (SLOW)
   268.0 ms - fl/math/ease.h (SLOW)
   265.6 ms - fl/math/fixed_point.h (SLOW)
   223.8 ms - fl/stl/function.h (SLOW)
   124.9 ms - fl/ui.h (SLOW)
   118.1 ms - fl/math/fixed_point/s4x12.h (SLOW)
   110.8 ms - fl/stl/vector.h (SLOW)
    97.0 ms - fl/math/sin32.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1406.0ms)
  ├─  663.1 ms - fl/task/executor.h
  │ ├─  375.4 ms - fl/task/scheduler.h
  │ │ ├─  365.7 ms - fl/stl/singleton.h
  │ │ │ └─  365.0 ms - fl/stl/thread_local.h
  │ │ │   └─  363.8 ms - fl/stl/thread.h
  │ │ │     └─  363.7 ms - platforms/thread.h
  │ │ │       └─  363.7 ms - platforms/stub/thread_stub.h
  │ │ │         └─  363.6 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  358.0 ms - thread
  │ │ │             ├─  223.9 ms - std_thread.h
  │ │ │             └─  107.0 ms - this_thread_sleep.h
  │ │ └─    8.9 ms - fl/task/task.h
  │ │   └─    3.6 ms - fl/trace.h
  │ │     ├─    2.3 ms - fl/stl/chrono.h
  │ │     └─    1.0 ms - fl/stl/tuple.h
  │ ├─  273.7 ms - fl/task/promise.h
  │ │ ├─  223.8 ms - fl/stl/function.h
  │ │ │ ├─  110.8 ms - fl/stl/vector.h
  │ │ │ │ ├─   69.2 ms - fl/math/math.h
  │ │ │ │ │ └─   63.4 ms - fl/stl/undef.h
  │ │ │ │ │   └─  101.8 ms - stdlib.h
  │ │ │ │ │     ├─   48.8 ms - cstdlib
  │ │ │ │ │     │ └─  101.8 ms - stdlib.h
  │ │ │ │ │     │   ├─   48.8 ms - cstdlib
  │ │ │ │ │     │   └─   11.2 ms - types.h
  │ │ │ │ │     └─   11.2 ms - types.h
  │ │ │ │ │       ├─   11.2 ms - types.h
  │ │ │ │ │       │ ├─   11.2 ms - types.h
  │ │ │ │ │       │ ├─    2.0 ms - pthreadtypes.h
  │ │ │ │ │       │ ├─    1.8 ms - select.h
  │ │ │ │ │       │ └─    1.7 ms - endian.h
  │ │ │ │ │       ├─    2.0 ms - pthreadtypes.h
  │ │ │ │ │       │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │ │       ├─    1.8 ms - select.h
  │ │ │ │ │       └─    1.7 ms - endian.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
  │ │ │ │ ├─   11.5 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.8 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.7 ms - fl/stl/functional.h
  │ │ │ ├─   60.0 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   38.9 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   32.4 ms - fl/stl/move.h
  │ │ │ │ ├─   15.8 ms - fl/stl/atomic.h
  │ │ │ │ │ └─   14.8 ms - platforms/atomic.h
  │ │ │ │ │   └─   14.8 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.8 ms - fl/stl/bit_cast.h
  │ │ │ ├─   38.0 ms - fl/stl/variant.h
  │ │ │ │ └─   36.2 ms - fl/stl/new.h
  │ │ │ │   └─   36.1 ms - platforms/new.h
  │ │ │ │     └─   36.1 ms - platforms/shared/new.h
  │ │ │ │       └─   27.7 ms - new
  │ │ │ │         ├─   13.7 ms - c++config.h
  │ │ │ │         │ └─    4.7 ms - os_defines.h
  │ │ │ │         └─    0.5 ms - version.h
  │ │ │ ├─    4.8 ms - fl/stl/algorithm.h
  │ │ │ │ └─    2.0 ms - fl/math/random.h
  │ │ │ │   └─    1.0 ms - fl/math/random8.h
  │ │ │ └─    4.6 ms - fl/stl/compiler_control.h
  │ │ └─   44.7 ms - fl/stl/string.h
  │ │   ├─   12.9 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.9 ms - fl/stl/string_view.h
  │ │   └─    1.5 ms - fl/stl/optional.h
  │ ├─   11.6 ms - platforms/await.h
  │ │ └─   11.2 ms - platforms/coroutine_runtime.h
  │ │   └─    9.6 ms - fl/system/engine_events.h
  │ │     ├─    4.9 ms - fl/math/screenmap.h
  │ │     │ └─    3.7 ms - fl/stl/flat_map.h
  │ │     └─    3.1 ms - fl/math/xymap.h
  │ │       └─    0.8 ms - fl/math/lut.h
  │ └─    0.8 ms - fl/task/promise_result.h
  ├─  473.5 ms - fl/fastled.h
  │ ├─  274.3 ms - crgb.h
  │ │ ├─  273.0 ms - fl/gfx/crgb.h
  │ │ │ └─  268.0 ms - fl/math/ease.h
  │ │ │   └─  265.6 ms - fl/math/fixed_point.h
  │ │ │     ├─  118.1 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─   97.0 ms - fl/math/sin32.h
  │ │ │     │ │ └─   93.8 ms - fl/math/simd.h
  │ │ │     │ │   └─   93.2 ms - fl/math/simd/types.h
  │ │ │     │ │     └─   92.9 ms - platforms/simd.h
  │ │ │     │ ├─    1.0 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.8 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   18.7 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   18.6 ms - fl/math/fixed_point/s16x16.h
  │ │ │     ├─   18.5 ms - fl/math/fixed_point/s8x8.h
  │ │ │     └─   18.2 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.9 ms - chsv.h
  │ │   └─    0.8 ms - fl/gfx/hsv.h
  │ ├─   88.5 ms - platforms.h
  │ │ └─   88.4 ms - platforms/stub/fastled_stub.h
  │ │   ├─   51.3 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   51.2 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   44.9 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   42.8 ms - fl/id_tracker.h
  │ │   │   │   └─   41.9 ms - fl/stl/mutex.h
  │ │   │   │     └─   41.8 ms - platforms/mutex.h
  │ │   │   │       └─   41.7 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.9 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   37.1 ms - platforms/stub/clockless_stub.h
  │ │     └─   37.1 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   13.2 ms - fl/system/log.h
  │ │       │ └─   12.8 ms - fl/stl/strstream.h
  │ │       ├─   13.2 ms - fl/channels/data.h
  │ │       │ └─    9.9 ms - fl/channels/config.h
  │ │       │   ├─    2.2 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.4 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.7 ms - fl/chipsets/spi.h
  │ │       ├─    2.4 ms - fl/channels/manager.h
  │ │       ├─    1.6 ms - fl/stl/weak_ptr.h
  │ │       └─    1.1 ms - fl/channels/driver.h
  │ ├─   42.2 ms - colorutils.h
  │ │ └─   41.4 ms - fl/gfx/colorutils.h
  │ │   ├─    8.8 ms - fl/gfx/blur.h
  │ │   │ └─    4.7 ms - fl/gfx/canvas.h
  │ │   │   └─    2.8 ms - fl/math/alpha.h
  │ │   └─    3.2 ms - fl/gfx/fill.h
  │ ├─   23.8 ms - pixel_controller.h
  │ │ ├─   17.2 ms - pixel_iterator.h
  │ │ │ └─   17.1 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    5.1 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    3.8 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    3.2 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    4.4 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    1.1 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.9 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.6 ms - rgbw.h
  │ │   └─    2.4 ms - fl/gfx/rgbw.h
  │ └─   23.1 ms - pixeltypes.h
  │   ├─   19.4 ms - lib8tion.h
  │   │ ├─   10.1 ms - fl/math/math8.h
  │   │ │ ├─    5.4 ms - fl/math/intmap.h
  │   │ │ │ └─    4.3 ms - platforms/intmap.h
  │   │ │ ├─    2.5 ms - fl/math/scale8.h
  │   │ │ │ └─    2.5 ms - platforms/scale8.h
  │   │ │ │   └─    1.1 ms - platforms/shared/scale8.h
  │   │ │ └─    2.1 ms - platforms/math8.h
  │   │ │   └─    1.6 ms - platforms/shared/math8.h
  │   │ ├─    2.0 ms - fl/math/beat.h
  │   │ │ └─    1.1 ms - fl/math/trig8.h
  │   │ │   └─    1.1 ms - platforms/trig8.h
  │   │ │     └─    0.9 ms - platforms/shared/trig8.h
  │   │ └─    0.5 ms - fl/math/qfx.h
  │   └─    3.3 ms - crgb.hpp
  ├─  124.9 ms - fl/ui.h
  │ ├─   78.5 ms - fl/stl/json.h
  │ │ └─   60.3 ms - fl/stl/json/types.h
  │ │   └─    7.5 ms - fl/stl/limits.h
  │ ├─   10.4 ms - fl/ui_impl.h
  │ │ └─    9.8 ms - platforms/ui_defs.h
  │ │   ├─    2.2 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    1.1 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.7 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.7 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/description.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/number_field.h
  │ │   └─    0.9 ms - platforms/shared/ui/json/dropdown.h
  │ └─    9.6 ms - fl/asset.h
  │   └─    8.5 ms - fl/stl/url.h
  ├─   43.0 ms - fl/stl/stdint.h
  │ └─   42.7 ms - platforms/int.h
  │   └─   42.3 ms - platforms/shared/int.h
  │     └─   42.2 ms - platforms/shared/int_linux.h
  └─   29.0 ms - chipsets.h
    ├─   11.8 ms - fl/chipsets/ucs7604.h
    │ └─    8.8 ms - fl/chipsets/encoders/ucs7604.h
    ├─    6.9 ms - fl/chipsets/apa102.h
    ├─    1.7 ms - fl/chipsets/lpd880x.h
    ├─    0.8 ms - fl/chipsets/p9813.h
    └─    0.8 ms - fl/chipsets/ws2801.h
fl/task/executor.h (663.1ms)
  ├─  375.4 ms - fl/task/scheduler.h
  │ ├─  365.7 ms - fl/stl/singleton.h
  │ │ └─  365.0 ms - fl/stl/thread_local.h
  │ │   └─  363.8 ms - fl/stl/thread.h
  │ │     └─  363.7 ms - platforms/thread.h
  │ │       └─  363.7 ms - platforms/stub/thread_stub.h
  │ │         └─  363.6 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  358.0 ms - thread
  │ │             ├─  223.9 ms - std_thread.h
  │ │             │ ├─   65.2 ms - tuple
  │ │             │ ├─   42.9 ms - iosfwd
  │ │             │ ├─   35.2 ms - refwrap.h
  │ │             │ ├─   12.3 ms - gthr.h
  │ │             │ └─    6.3 ms - unique_ptr.h
  │ │             └─  107.0 ms - this_thread_sleep.h
  │ │               ├─   94.4 ms - chrono.h
  │ │               └─    3.6 ms - cerrno
  │ └─    8.9 ms - fl/task/task.h
  │   └─    3.6 ms - fl/trace.h
  │     ├─    2.3 ms - fl/stl/chrono.h
  │     └─    1.0 ms - fl/stl/tuple.h
  ├─  273.7 ms - fl/task/promise.h
  │ ├─  223.8 ms - fl/stl/function.h
  │ │ ├─  110.8 ms - fl/stl/vector.h
  │ │ │ ├─   69.2 ms - fl/math/math.h
  │ │ │ │ └─   63.4 ms - fl/stl/undef.h
  │ │ │ │   └─  101.8 ms - stdlib.h
  │ │ │ │     ├─   48.8 ms - cstdlib
  │ │ │ │     │ └─  101.8 ms - stdlib.h
  │ │ │ │     │   ├─   48.8 ms - cstdlib
  │ │ │ │     │   │ └─  101.8 ms - stdlib.h
  │ │ │ │     │   └─   11.2 ms - types.h
  │ │ │ │     │     ├─   11.2 ms - types.h
  │ │ │ │     │     ├─    2.0 ms - pthreadtypes.h
  │ │ │ │     │     ├─    1.8 ms - select.h
  │ │ │ │     │     └─    1.7 ms - endian.h
  │ │ │ │     └─   11.2 ms - types.h
  │ │ │ │       ├─   11.2 ms - types.h
  │ │ │ │       │ ├─   11.2 ms - types.h
  │ │ │ │       │ │ ├─   11.2 ms - types.h
  │ │ │ │       │ │ ├─    2.0 ms - pthreadtypes.h
  │ │ │ │       │ │ ├─    1.8 ms - select.h
  │ │ │ │       │ │ └─    1.7 ms - endian.h
  │ │ │ │       │ ├─    2.0 ms - pthreadtypes.h
  │ │ │ │       │ │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │       │ ├─    1.8 ms - select.h
  │ │ │ │       │ └─    1.7 ms - endian.h
  │ │ │ │       ├─    2.0 ms - pthreadtypes.h
  │ │ │ │       │ └─    1.5 ms - thread-shared-types.h
  │ │ │ │       ├─    1.8 ms - select.h
  │ │ │ │       └─    1.7 ms - endian.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
  │ │ │ ├─   11.5 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.8 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.7 ms - fl/stl/functional.h
  │ │ ├─   60.0 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   38.9 ms - fl/stl/type_traits.h
  │ │ │ │ └─   32.4 ms - fl/stl/move.h
  │ │ │ ├─   15.8 ms - fl/stl/atomic.h
  │ │ │ │ └─   14.8 ms - platforms/atomic.h
  │ │ │ │   └─   14.8 ms - platforms/shared/atomic.h
  │ │ │ └─    0.8 ms - fl/stl/bit_cast.h
  │ │ ├─   38.0 ms - fl/stl/variant.h
  │ │ │ └─   36.2 ms - fl/stl/new.h
  │ │ │   └─   36.1 ms - platforms/new.h
  │ │ │     └─   36.1 ms - platforms/shared/new.h
  │ │ │       └─   27.7 ms - new
  │ │ │         ├─   13.7 ms - c++config.h
  │ │ │         │ └─    4.7 ms - os_defines.h
  │ │ │         │   └─    4.3 ms - features.h
  │ │ │         └─    0.5 ms - version.h
  │ │ ├─    4.8 ms - fl/stl/algorithm.h
  │ │ │ └─    2.0 ms - fl/math/random.h
  │ │ │   └─    1.0 ms - fl/math/random8.h
  │ │ └─    4.6 ms - fl/stl/compiler_control.h
  │ └─   44.7 ms - fl/stl/string.h
  │   ├─   12.9 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.9 ms - fl/stl/string_view.h
  │   └─    1.5 ms - fl/stl/optional.h
  ├─   11.6 ms - platforms/await.h
  │ └─   11.2 ms - platforms/coroutine_runtime.h
  │   └─    9.6 ms - fl/system/engine_events.h
  │     ├─    4.9 ms - fl/math/screenmap.h
  │     │ └─    3.7 ms - fl/stl/flat_map.h
  │     └─    3.1 ms - fl/math/xymap.h
  │       └─    0.8 ms - fl/math/lut.h
  └─    0.8 ms - fl/task/promise_result.h
fl/fastled.h (473.5ms)
  ├─  274.3 ms - crgb.h
  │ ├─  273.0 ms - fl/gfx/crgb.h
  │ │ └─  268.0 ms - fl/math/ease.h
  │ │   └─  265.6 ms - fl/math/fixed_point.h
  │ │     ├─  118.1 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─   97.0 ms - fl/math/sin32.h
  │ │     │ │ └─   93.8 ms - fl/math/simd.h
  │ │     │ │   └─   93.2 ms - fl/math/simd/types.h
  │ │     │ │     └─   92.9 ms - platforms/simd.h
  │ │     │ │       └─   92.9 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.7 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   18.6 ms - fl/math/fixed_point/s16x16.h
  │ │     ├─   18.5 ms - fl/math/fixed_point/s8x8.h
  │ │     └─   18.2 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.9 ms - chsv.h
  │   └─    0.8 ms - fl/gfx/hsv.h
  ├─   88.5 ms - platforms.h
  │ └─   88.4 ms - platforms/stub/fastled_stub.h
  │   ├─   51.3 ms - platforms/stub/fastspi_stub.h
  │   │ └─   51.2 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   44.9 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   42.8 ms - fl/id_tracker.h
  │   │   │   └─   41.9 ms - fl/stl/mutex.h
  │   │   │     └─   41.8 ms - platforms/mutex.h
  │   │   │       └─   41.7 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   41.6 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.9 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   37.1 ms - platforms/stub/clockless_stub.h
  │     └─   37.1 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   13.2 ms - fl/system/log.h
  │       │ └─   12.8 ms - fl/stl/strstream.h
  │       ├─   13.2 ms - fl/channels/data.h
  │       │ └─    9.9 ms - fl/channels/config.h
  │       │   ├─    2.2 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.4 ms - fl/chipsets/led_timing.h
  │       │   └─    1.7 ms - fl/chipsets/spi.h
  │       ├─    2.4 ms - fl/channels/manager.h
  │       ├─    1.6 ms - fl/stl/weak_ptr.h
  │       └─    1.1 ms - fl/channels/driver.h
  ├─   42.2 ms - colorutils.h
  │ └─   41.4 ms - fl/gfx/colorutils.h
  │   ├─    8.8 ms - fl/gfx/blur.h
  │   │ └─    4.7 ms - fl/gfx/canvas.h
  │   │   └─    2.8 ms - fl/math/alpha.h
  │   └─    3.2 ms - fl/gfx/fill.h
  ├─   23.8 ms - pixel_controller.h
  │ ├─   17.2 ms - pixel_iterator.h
  │ │ └─   17.1 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    5.1 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    3.8 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    3.2 ms - fl/gfx/gamma_lut.h
  │ │   ├─    4.4 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    1.1 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.9 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.6 ms - rgbw.h
  │   └─    2.4 ms - fl/gfx/rgbw.h
  └─   23.1 ms - pixeltypes.h
    ├─   19.4 ms - lib8tion.h
    │ ├─   10.1 ms - fl/math/math8.h
    │ │ ├─    5.4 ms - fl/math/intmap.h
    │ │ │ └─    4.3 ms - platforms/intmap.h
    │ │ ├─    2.5 ms - fl/math/scale8.h
    │ │ │ └─    2.5 ms - platforms/scale8.h
    │ │ │   └─    1.1 ms - platforms/shared/scale8.h
    │ │ └─    2.1 ms - platforms/math8.h
    │ │   └─    1.6 ms - platforms/shared/math8.h
    │ ├─    2.0 ms - fl/math/beat.h
    │ │ └─    1.1 ms - fl/math/trig8.h
    │ │   └─    1.1 ms - platforms/trig8.h
    │ │     └─    0.9 ms - platforms/shared/trig8.h
    │ └─    0.5 ms - fl/math/qfx.h
    └─    3.3 ms - crgb.hpp
fl/ui.h (124.9ms)
  ├─   78.5 ms - fl/stl/json.h
  │ └─   60.3 ms - fl/stl/json/types.h
  │   └─    7.5 ms - fl/stl/limits.h
  ├─   10.4 ms - fl/ui_impl.h
  │ └─    9.8 ms - platforms/ui_defs.h
  │   ├─    2.2 ms - platforms/shared/ui/json/audio.h
  │   │ └─    1.1 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.7 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.7 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    0.9 ms - platforms/shared/ui/json/description.h
  │   ├─    0.9 ms - platforms/shared/ui/json/number_field.h
  │   └─    0.9 ms - platforms/shared/ui/json/dropdown.h
  └─    9.6 ms - fl/asset.h
    └─    8.5 ms - fl/stl/url.h
fl/stl/stdint.h (43.0ms)
  └─   42.7 ms - platforms/int.h
    └─   42.3 ms - platforms/shared/int.h
      └─   42.2 ms - platforms/shared/int_linux.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1406.0 ms - Source: FastLED.h
  2.  1406.0 ms - Total Source: 
  3.   663.7 ms - Total ParseClass: 
  4.   663.1 ms - Source: fl/task/executor.h
  5.   473.5 ms - Source: fl/fastled.h
  6.   375.4 ms - Source: fl/task/scheduler.h
  7.   365.7 ms - Source: fl/stl/singleton.h
  8.   365.0 ms - Source: fl/stl/thread_local.h
  9.   363.8 ms - Source: fl/stl/thread.h
 10.   363.7 ms - Source: platforms/thread.h
 11.   363.7 ms - Source: platforms/stub/thread_stub.h
 12.   363.6 ms - Source: platforms/stub/thread_stub_stl.h
 13.   358.0 ms - Source: thread
 14.   274.3 ms - Source: crgb.h
 15.   273.7 ms - Source: fl/task/promise.h
 16.   273.0 ms - Source: fl/gfx/crgb.h
 17.   268.0 ms - Source: fl/math/ease.h
 18.   265.6 ms - Source: fl/math/fixed_point.h
 19.   223.9 ms - Source: std_thread.h
 20.   223.8 ms - Source: fl/stl/function.h

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1406.0ms)
    - fl/task/executor.h (663.1ms)
    - fl/fastled.h (473.5ms)
    - fl/task/scheduler.h (375.4ms)
    - fl/stl/singleton.h (365.7ms)
    - fl/stl/thread_local.h (365.0ms)
    - fl/stl/thread.h (363.8ms)
    - platforms/thread.h (363.7ms)
    - platforms/stub/thread_stub.h (363.7ms)
    - platforms/stub/thread_stub_stl.h (363.6ms)

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

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1406.0ms)
2. Consider optimizing fl/task/executor.h (663.1ms)
3. Consider optimizing fl/fastled.h (473.5ms)

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/power_mgt.cpp.hpp (1)

271-292: set_power_scaling_exponent correctly round-trips through set_power_model, but note the read-modify-write on the singleton.

set_power_scaling_exponent fetches the current model by value, mutates exponent, and calls set_power_model, which on small-memory targets stomps exponent back to 1.0f. That matches the documented behavior (no-op on small memory, get_power_scaling_exponent() returns 1.0).

Minor: since this is a read-modify-write on gPowerModel(), any future concurrent caller (e.g., a UI task setting the exponent while show() runs) would race. Not an issue today given FastLED is single-threaded on MCU, but if you ever expose this from a UI widget running on a separate core (ESP32), consider guarding the singleton or documenting single-thread-only usage.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/power_mgt.cpp.hpp` around lines 271 - 292, set_power_scaling_exponent
performs a read-modify-write on the global singleton gPowerModel() which can
race if accessed from multiple threads/cores; to fix, protect the operation (and
any other writers) with a lightweight lock or critical section around the
read-modify-write and the setter path (e.g., add a mutex/critical section used
by set_power_scaling_exponent and set_power_model), or alternatively add a brief
comment documenting that gPowerModel()/set_power_scaling_exponent are
single-thread-only; update references to gPowerModel(), set_power_model(), and
get_power_scaling_exponent() accordingly so all writers/readers use the same
protection.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/power_mgt.cpp.hpp`:
- Around line 271-292: set_power_scaling_exponent performs a read-modify-write
on the global singleton gPowerModel() which can race if accessed from multiple
threads/cores; to fix, protect the operation (and any other writers) with a
lightweight lock or critical section around the read-modify-write and the setter
path (e.g., add a mutex/critical section used by set_power_scaling_exponent and
set_power_model), or alternatively add a brief comment documenting that
gPowerModel()/set_power_scaling_exponent are single-thread-only; update
references to gPowerModel(), set_power_model(), and get_power_scaling_exponent()
accordingly so all writers/readers use the same protection.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 51cd47c5-3714-4a43-bbd0-da6c07129327

📥 Commits

Reviewing files that changed from the base of the PR and between 82111e8 and 34820bb.

📒 Files selected for processing (6)
  • src/FastLED.cpp.hpp
  • src/FastLED.h
  • src/power_mgt.cpp.hpp
  • src/power_mgt.h
  • tests/fl/power_estimation.cpp
  • tests/power_mgt.cpp
✅ Files skipped from review due to trivial changes (1)
  • tests/power_mgt.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/FastLED.cpp.hpp
  • tests/fl/power_estimation.cpp

@zackees zackees merged commit acd37b8 into master Apr 21, 2026
68 of 87 checks passed
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