remove unmaintained WLED_SAVE_RAM - #5752
Conversation
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.
Walkthrough
ChangesWLED_SAVE_RAM storage unification
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)
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
| RgbConnected = c3; | ||
| } | ||
| } __attribute__ ((aligned(1), packed)) udp_port_t; | ||
| WLED_GLOBAL udp_port_t udp _INIT_N(({21234, 65506, 19446, 0, false, false, false})); |
There was a problem hiding this comment.
Just to prove me right 😜 , this line actually has a bug - 21234 (udp port) should be 21324 (middle 2<->3 swapped)
|
I'm late to the party on this one, but 100% agree - saving these few bytes are not worth the code duplication. |
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.