Repository navigation
Description
Goal
Apply the same release-gate to `RxChannel::makeName` that #2943 applied to `Channel::makeName`. The auto-naming branch synthesizes `"RxChannel_"` purely for diagnostic consumption; in release builds (NDEBUG → `FASTLED_LOG_VERBOSITY=0` per #2890) every FL_WARN/FL_ERROR site that reads the name collapses, so the string + `fl::to_string` + heap concat run for nothing.
Parent: #2886 — symmetry win against #2943.
Why this is a real win
`src/fl/channels/rx/channel.cpp.hpp:46-51`:
```cpp
fl::string RxChannel::makeName(i32 id, const fl::string& config_name) FL_NOEXCEPT {
if (!config_name.empty()) {
return config_name;
}
return "RxChannel_" + fl::to_string(static_cast(id));
}
```
This is the exact pattern #2943 fixed for `Channel::makeName` — the difference is just the prefix (`"RxChannel_"` instead of `"Channel_"`) and the config-name source (a `fl::string` rather than an `fl::optionalfl::string`).
RxChannel is reachable from `src/platforms/esp/32/drivers/rmt_rx/rmt_rx_channel.cpp.hpp` + `src/platforms/esp/32/drivers/gpio_isr_rx/gpio_isr_rx.cpp.hpp`. Whether it ends up in a TX-only NEOPIXEL Blink's transitive closure depends on the linker's dead-strip — the post-merge bloat regression run will tell us directly via `tests/test_esp32s3_bloat_regression.py`.
Even if the saving on the stock Blink baseline is 0 B (RxChannel may not be reachable), this is correct hygiene that matches the #2943 idiom — and any future sketch that uses an RX channel inherits the saving.
Deliverable
`src/fl/channels/rx/channel.cpp.hpp` — gate the auto-naming
```cpp
fl::string RxChannel::makeName(i32 id, const fl::string& config_name) FL_NOEXCEPT {
if (!config_name.empty()) {
return config_name;
}
#if FASTLED_LOG_RUNTIME_ENABLED
return "RxChannel_" + fl::to_string(static_cast(id));
#else
(void)id;
return {};
#endif
}
```
User-provided names (`config.name.empty() == false`) are unaffected — they keep their explicit value in both debug and release.
Behavior matrix
| Build | config_name | mName value |
|---|---|---|
| Debug (`FASTLED_LOG_VERBOSITY=1`) | non-empty | config_name |
| Debug | empty | `"RxChannel_"` |
| Release (`FASTLED_LOG_VERBOSITY=0`) | non-empty | config_name |
| Release | empty | `""` (empty) |
Acceptance
- `bash lint --cpp` passes.
- Behaviour preserved in debug builds.
- Bloat regression gate either passes with positive headroom (RxChannel reachable in Blink) or reports zero delta (not reachable). Either is fine — the fix is correct symmetry.
Expected savings
Projected 0-200 B on the Blink baseline (depending on RxChannel reachability), but any user-built RX sketch gains the same dead-strip cascade #2943 measured (−1,845 B observed).
Out of scope
- Refactoring the `RxChannel` API surface. Public name accessor unchanged.
- Removing the `mName` field. Cost is a single `fl::string` (16-24 bytes per channel object) and keeping it symmetrical with `Channel` aids readers.
Related
- Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886 — parent meta + audit cycle.
- perf(log): default FASTLED_LOG_VERBOSITY=0 in release builds (#2886 Stage 1) #2890 — Stage 1 (the `FASTLED_LOG_VERBOSITY=0` default).
- Skip Channel auto-naming in release builds (~100-300 B) (#2886) #2942 / perf(channel): skip auto-naming in release builds (#2942) #2943 — original `Channel::makeName` gate this PR mirrors.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
perf(rx-channel): skip auto-naming in release builds (FastLED#2954) (F…