Skip to content

remove unmaintained WLED_SAVE_RAM#5752

Merged
softhack007 merged 1 commit into
mainfrom
remove_save_ram
Jul 22, 2026
Merged

remove unmaintained WLED_SAVE_RAM#5752
softhack007 merged 1 commit into
mainfrom
remove_save_ram

Conversation

@softhack007

@softhack007 softhack007 commented Jul 21, 2026

Copy link
Copy Markdown
Member

On 8266, compiling with WLED_SAVE_RAM increases flash program size by 1.2KB, while reducing static RAM by 20 bytes only. Plus it reduces the size of the Segment::Transition struct by 48 bytes (from 80 to 32), by avoiding a separate palette for blending.

On the other side, the WLED_SAVE_RAM special code is not maintained (corner case, needs a special build flag to activate), and its largely untested with the latest codebase.

I suggest removing this micro-optimization, for the sake of maintainability, and for reducing special cases alternate implementations.

On 8266, compiling with WLED_SAVE_RAM increases flash size by 1.2KB, while reducing static RAM by 20KB only. Plus it reduves the size of the transition struct by 48 bytes (from 80 to 32).

In the other side, the WLED_SAVE_RAM special code is not maintained, it introduces a slowdown, and its largely untested with the latest codebase.

I suggest to remove this micro-optimization.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

WLED_SAVE_RAM-specific packed storage and conditional aliases are removed for WiFi, notification, and UDP options. Palette transitions always allocate and use _palT for initialization and blending.

Changes

WLED_SAVE_RAM storage unification

Layer / File(s) Summary
Global option storage contracts
wled00/wled.h
WiFi, notification, and UDP settings are declared as unconditional standalone globals instead of packed types and macro aliases.
Palette transition flow
wled00/FX.h, wled00/FX_fcn.cpp
_palT is always present, initialized during transitions, and used for palette blending during drawing.

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

Sequence Diagram(s)

sequenceDiagram
  participant SegmentStartTransition
  participant Transition
  participant SegmentBeginDraw
  SegmentStartTransition->>Transition: loadPalette(_palT, palette)
  SegmentBeginDraw->>Transition: read _palT
  SegmentBeginDraw->>SegmentBeginDraw: nblendPaletteTowardPalette(_currentPalette, _palT)
Loading

Possibly related PRs

  • wled/WLED#4506: Uses palette data during particle effect transitions, overlapping with the unconditional transition palette handling.
  • wled/WLED#5601: Adjusts transition bookkeeping in the same FX_fcn.cpp transition paths.

Suggested labels: optimization, major

Suggested reviewers: dedehai

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: removing the unmaintained WLED_SAVE_RAM optimization.

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.

@softhack007 softhack007 added minor Easy fix. Should not take long optimization re-working an existing feature to be faster, or use less memory labels Jul 21, 2026
Comment thread wled00/wled.h
RgbConnected = c3;
}
} __attribute__ ((aligned(1), packed)) udp_port_t;
WLED_GLOBAL udp_port_t udp _INIT_N(({21234, 65506, 19446, 0, false, false, false}));

@softhack007 softhack007 Jul 21, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to prove me right 😜 , this line actually has a bug - 21234 (udp port) should be 21324 (middle 2<->3 swapped)

@softhack007
softhack007 merged commit 67d993d into main Jul 22, 2026
68 checks passed
@softhack007
softhack007 deleted the remove_save_ram branch July 22, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Easy fix. Should not take long optimization re-working an existing feature to be faster, or use less memory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants