Skip to content

perf(rx-channel): skip auto-naming in release builds (#2954) - #2955

Merged
zackees merged 1 commit into
masterfrom
feat/2954-gate-rxchannel-makename
Jun 7, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/2954-gate-rxchannel-makename

Conversation

@zackees

@zackees zackees commented Jun 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Behavior matrix

Build config_name mName value
Debug non-empty config_name
Debug empty `"RxChannel_"`
Release non-empty config_name
Release empty `""` (empty)

Test plan

Closes #2954. Refs #2886.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Optimized channel naming performance by reducing unnecessary string construction when logging is disabled, improving efficiency in non-logging builds.

Companion fix to #2943: mirrors the Channel::makeName release-gate
on RxChannel::makeName. The auto-naming branch synthesizes
`"RxChannel_<id>"` only for diagnostic consumption; in release
builds (NDEBUG → FASTLED_LOG_VERBOSITY=0 per #2890) every read
site collapses to do-while-0, so the string + `fl::to_string<i64>`
+ heap concat run for nothing.

User-provided names (config.name non-empty) are unchanged in both
debug and release.

Closes #2954. Refs #2886.

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

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f9735b64-a981-44c8-a594-aa7ba93195bf

📥 Commits

Reviewing files that changed from the base of the PR and between 97fe686 and 3757741.

📒 Files selected for processing (1)
  • src/fl/channels/rx/channel.cpp.hpp

📝 Walkthrough

Walkthrough

RxChannel::makeName now conditionally synthesizes the default diagnostic name ("RxChannel_" + id) only when FASTLED_LOG_RUNTIME_ENABLED is true. In release builds where runtime logging is disabled, the function returns an empty string, eliminating the unconditional string concatenation and numeric formatting overhead that occurred previously in all builds. User-provided names remain unaffected across all configurations.

Changes

Release-build logging gate for RxChannel auto-naming

Layer / File(s) Summary
Conditional name generation with logging gate
src/fl/channels/rx/channel.cpp.hpp
Added fl/log/log.h include to enable the FASTLED_LOG_RUNTIME_ENABLED preprocessor gate. Updated RxChannel::makeName to return an empty fl::string when the logging gate is disabled, avoiding the "RxChannel_" + fl::to_string(id) synthesis overhead in release builds while preserving explicit config_name values in all configurations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • FastLED/FastLED#2942: Companion issue describing the release-gate pattern applied to Channel-like auto-naming helpers.

Possibly related PRs

  • FastLED/FastLED#2943: Identical pattern applied to Channel::makeName — gates the "Channel_<id>" name synthesis on FASTLED_LOG_RUNTIME_ENABLED to skip overhead in release builds.

Poem

🐰 A channel by any other name would run the same,
But in release builds, we trim the diagnostic flame—
No strings to build when logging sleeps away,
Just empty names and leaner code today! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically summarizes the main change: conditional compilation of RxChannel auto-naming to skip in release builds.
Linked Issues check ✅ Passed The code change directly implements the deliverable from issue #2954: gating auto-naming with FASTLED_LOG_RUNTIME_ENABLED, returning empty string in release builds when config_name is empty.
Out of Scope Changes check ✅ Passed All changes are scoped to the RxChannel::makeName function modification specified in issue #2954; no unrelated modifications present.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/2954-gate-rxchannel-makename

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.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 7, 2026
@zackees
zackees merged commit 69e71b7 into master Jun 7, 2026
8 of 9 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 7, 2026
@zackees
zackees deleted the feat/2954-gate-rxchannel-makename branch August 21, 2026 19:15
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.

Skip RxChannel auto-naming in release builds (companion to #2943)

1 participant