Skip to content

perf: define getBaseSettingsList() once - #69

Merged
prokrypt merged 1 commit into
developmentfrom
perf/settings-list-once
Oct 1, 2026
Merged

prokrypt merged 1 commit into
developmentfrom
perf/settings-list-once

Conversation

@prokrypt

@prokrypt prokrypt commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Before: getBaseSettingsList() was an inline function in src/SettingsList.h. Every file that inlined it kept a private ~8 KB copy of the settings-list builder lambda, and the C3 firmware carried two of them.

After: one definition in the new src/SettingsList.cpp, so the firmware has a single builder lambda. Behavior is unchanged: the body moved verbatim, still builds the list once into a function-local static, and reserves the same capacity.

How: the function body moves from the header into a .cpp, and the header keeps only the declaration. This is the same change as CrossDink f08b7b3.

Sizes, C3 default, vs development 76473c2:

  • Flash: 6,296,113 → 6,287,529 (−8,584 B, 96.1% → 95.9%)
  • RAM: 65,232 → 65,032 (−200 B)
  • Symbols: the builder getBaseSettingsList()::{lambda()#1}::operator() had two copies before (8,078 B + 8,200 B) and has one after (8,546 B). The duplicated std::function handlers are gone too.

Verify on hardware: open Settings and check each category lists the same entries; change a setting, reboot, and confirm it persisted. The web settings page should list the same settings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XgLRarbAmBVepTPKCK7mgd


Generated by Claude Code

As an inline header function, every file that inlined it kept a private
~8 KB copy of the settings-list builder lambda. One definition in
SettingsList.cpp keeps a single copy. Same change as CrossDink f08b7b3.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XgLRarbAmBVepTPKCK7mgd
@prokrypt
prokrypt merged commit fe30164 into development Oct 1, 2026
12 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.

2 participants