feat(esp): add production size-optimization flags to all 11 ESP starter configs#15
Conversation
…er configs
ESP32-family and ESP8266 starter configs all linked at ~600 KB
Blink-class binaries because the default Arduino-ESP32 build carries:
- build_type = debug + -Og (no optimization)
- CORE_DEBUG_LEVEL=5 + ESP_LOG_VERBOSE (every log string compiled in)
- full libstdc++ exception machinery (no -fno-exceptions / -fno-rtti)
- no per-function/data sections + no -Wl,--gc-sections, so the linker
drops nothing it doesn't have to
Adds a heavily commented [build_type=release / build_flags / build_unflags]
block to each ESP env. Result on FastLED's own esp32dev CI:
Blink: 631100 B -> 408136 B (-223 KB / -35%)
The block is fully commented for new users: 'comment out (or set
build_type = debug) when you need verbose logs / exception decoding
while developing.' Each file points to the FastLED PR that did the
investigation (FastLED/FastLED#3268).
Files updated (all 11):
platformio.esp32c2.ini
platformio.esp32c3.ini
platformio.esp32c5.ini (preserves existing PARLIO ISR flags)
platformio.esp32c6.ini (preserves existing PARLIO ISR flags)
platformio.esp32dev.ini
platformio.esp32h2.ini (preserves existing PARLIO ISR flags)
platformio.esp32p4.ini (preserves existing PARLIO ISR flags)
platformio.esp32s2.ini
platformio.esp32s3.ini (preserves existing exception_decoder filter)
platformio.esp8266.ini (NONOS SDK — no CORE_DEBUG_LEVEL macro)
platformio.seeed_xiao_esp32s3.ini
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughAll ten ESP32 and ESP8266 PlatformIO environment INI files receive a uniform size-optimization release build configuration: ChangesSize Optimization Release Build Config
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Summary
ESP32-family and ESP8266 starter configs all linked at ~600 KB Blink-class binaries because the default Arduino-ESP32 build carries:
build_type = debug+-Og(no optimization)CORE_DEBUG_LEVEL=5+ESP_LOG_VERBOSE(every log string compiled in)-fno-exceptions/-fno-rtti)-Wl,--gc-sections, so the linker drops nothing it doesn't have toThis PR adds a heavily commented
[build_type=release / build_flags / build_unflags]block to each ESP env.Verified savings (from FastLED's own esp32dev CI, FastLED/FastLED#3268):
The block is fully commented for new users: "comment out (or set
build_type = debug) when you need verbose logs / exception decoding while developing." Each file points to FastLED/FastLED#3268 for the underlying investigation.Files updated (all 11 ESP starters)
platformio.esp32c2.iniplatformio.esp32c3.iniplatformio.esp32c5.ini(preserves existing PARLIO ISR flags)platformio.esp32c6.ini(preserves existing PARLIO ISR flags)platformio.esp32dev.iniplatformio.esp32h2.ini(preserves existing PARLIO ISR flags)platformio.esp32p4.ini(preserves existing PARLIO ISR flags)platformio.esp32s2.iniplatformio.esp32s3.ini(preserves existing exception_decoder filter)platformio.esp8266.ini(NONOS SDK — noCORE_DEBUG_LEVELmacro)platformio.seeed_xiao_esp32s3.iniTest plan
platforms/— flags are appropriate for the SDK each targets (ESP-IDF for esp32-family, NONOS for esp8266).🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes