Skip to content

perf(channels): isolate addDriver slow path - #3895

Merged
zackees merged 1 commit into
masterfrom
fix/2979-channel-manager-cold-path
Aug 18, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2979-channel-manager-cold-path

Conversation

@zackees

@zackees zackees commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • move ChannelManager::addDriver validation, duplicate logging, wait, and replacement cleanup into a noinline cold helper
  • keep the common registration path focused on name lookup, insertion, callback setup, exclusive-mode enablement, and sorting
  • add a portable FL_COLD compiler-control macro
  • remove duplicate log includes encountered in the implementation file

Verification

  • bash test manager --unit
  • bash test channel_manager --unit
  • bash test fastled_core --unit
  • bash test manager --unit --build-mode release
  • bash lint
  • git diff --check
  • clud-review: clean

Measurement note

Both ESP32-S3 build routes stalled in first-use package/toolchain setup before compilation, so the requested ESP32-S3 symbol-size comparison could not be produced on this host. The structural gate is present: the slow helper is both FL_NO_INLINE and FL_COLD, and release-mode host compilation/tests pass.

Closes #2979

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of invalid, duplicate, and replacement driver registrations.
    • Ensured driver replacements correctly rescan available drivers after readiness checks.
    • Prevented stale driver entries from remaining after replacement.

@zackees
zackees merged commit bca68e7 into master Aug 18, 2026
8 of 17 checks passed
@zackees
zackees deleted the fix/2979-channel-manager-cold-path branch August 18, 2026 22:54
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Aug 18, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b06b03f3-f310-4e70-9094-c27671254a20

📥 Commits

Reviewing files that changed from the base of the PR and between 2fde0ea and 19b7d44.

📒 Files selected for processing (3)
  • src/fl/channels/manager.cpp.hpp
  • src/fl/channels/manager.h
  • src/fl/stl/compiler_control.h

📝 Walkthrough

Walkthrough

ChannelManager::addDriver now keeps normal registration separate from exceptional paths. A cold, non-inlined helper handles invalid drivers, empty names, duplicate registrations, and replacements. FL_COLD provides cross-compiler support.

Changes

Driver registration flow

Layer / File(s) Summary
Cold helper contract
src/fl/stl/compiler_control.h, src/fl/channels/manager.h
Adds the cross-compiler FL_COLD macro and declares the private helper and reason classification.
Registration path handling
src/fl/channels/manager.cpp.hpp
Moves validation, duplicate handling, logging, readiness waiting, and old-driver removal into addDriverSlow. Replacement rescans the driver list after readiness completes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2979-channel-manager-cold-path

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.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bloat: extract addDriver validation + log paths into [[gnu::cold]] helper

1 participant