Repository navigation
perf(channels): check driver enabled state by instance in show paths (#4799) - #4820
Conversation
…4799) SlimBridgeController, SlimSpiBridgeController and the Teensy 4 block clockless controller called isDriverEnabled(driver.getName().c_str()) every frame: an fl::string per frame plus a name compare per registry entry. Add ChannelManager::isDriverEnabled(const IChannelDriver&), which matches the registry entry by pointer (falling back to the name for an unregistered instance), and use it on those paths. Flash ~neutral (esp32dev Blink -28 B, APA102 +68 B); per-frame string work removed. Unit test covers pointer match, disable, and the name fallback.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughChannelManager adds an overload that checks driver enablement by instance, with name-based fallback for unregistered instances. Three show paths now pass driver instances to this overload, and tests cover instance lookup and fallback behavior. ChangesDriver Enablement Lookup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The show paths retain their enabled-driver behavior while using instance-based lookup; no material merge risk remains. Pre-merge checks |
|
Part of #4801. Addresses #4799 (the per-frame string work in the show path).
Change
SlimBridgeController,SlimSpiBridgeControllerand the Teensy 4 block clockless controller calledisDriverEnabled(driver.getName().c_str())on every frame. That built anfl::stringper frame and compared names against every registry entry.The new
ChannelManager::isDriverEnabled(const IChannelDriver&)matches the registry entry by pointer. It falls back to the name for an instance that isn't the registered one, which preserves the old semantics. Those three paths now use it.Not changed, and why
resolveDriver()bus key: a non-allocating literal string.IChannelDriver::getName()into IDs means 32 overrides, about 140 call sites and a public interface change; deferred.Evidence (dashboard protocol)
tests/fl/channels/manager.cpp: pointer match, disable, and name fallback.bash test --cpppasses.bash lintpasses. teensy40/41 budgets pass.Summary by CodeRabbit