Replies: 2 comments 6 replies
-
Hello, The bench you saw is indeed bad for ESP8266 because all the recent changes and improvements on the lib so far are done and focused on ESP32 only. We keep the lib compatible (meaning... compilable) with ESP8266 but there is no more work neither perf improvements on ESP8266. The constraints set by ESP8266 when dealing with constant string is so messy that it bloaters the code with macros, that are only specific to ESP8266. That being said, if someone sends a clean PR to improve current perf in a way that is isolated from the rest, I think we will be OK to merge. I insists on the words clean and isolated, because there is a maintenance cost associated to that. FYI, we do not support ESP8266 anymore, ESP8266 hardware will go EOL in a few years and next major version of this lib will not support ESP8266. Also, ESP8266 is single-core, which limits the benefit of an asynchronous lib. |
Beta Was this translation helpful? Give feedback.
-
Thank you for taking the time to respond and for maintaining this excellent library! I really appreciate your openness to a clean PR despite the challenges. I completely understand and share your sentiment about ESP8266 reaching EOL - we'd all love to see the ecosystem move to more capable chips. However, the reality is that ESP8266 will likely persist in the wild for quite some time. Many users have dozens of these devices deployed and aren't eager to replace functioning hardware, and unfortunately, vendors are still shipping new products with ESP8266 chips (presumably due to cost and existing inventory). A clean solution for ESP8266 PROGMEM support is challenging. The platform's quirks around flash string handling would indeed require careful macro work to avoid cluttering the codebase. After looking at the code, I can see why wrapping everything in platform-specific macros would be a maintenance burden. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Platform
ESP8266
IDE / Tooling
Arduino (IDE/CLI)
What happened?
Hi! First, I want to thank you for creating and maintaining ESPAsyncWebServer - it's an excellent library that has been invaluable for countless ESP8266 and ESP32 projects. The async architecture and feature set are fantastic.
I've been doing some memory profiling on ESP8266 projects and noticed that the string literals defined in
src/literals.h
(HTTP status messages, MIME types, and header names) are currently stored in RAM via the.rodata
section, consuming approximately 2KB.Would you be open to considering moving these string constants to PROGMEM on ESP8266 builds? This could free up nearly 2KB of RAM on a platform where every byte counts, while having minimal performance impact since these strings are accessed relatively infrequently.
Perhaps a hybrid approach could work well - keeping frequently-used strings (like "OK", "text/html", common headers) in RAM for performance, while moving the less common HTTP status messages and MIME types to PROGMEM. Of course, you know the library's usage patterns best, so any approach you think makes sense would be wonderful.
I understand this would require some refactoring to handle the different string access methods between platforms, but the RAM savings on ESP8266 could be quite beneficial for memory-constrained applications.
Thanks again for all your work on this library - it really is appreciated by the community!
Stack Trace
n/a
Minimal Reproductible Example (MRE)
python3 analyze_ram_strings.py .esphome/build/log8266/.pioenvs/log8266/firmware.elf --min-length 10
I confirm that:
Beta Was this translation helpful? Give feedback.
All reactions