Replies: 5 comments
-
Not really a PsychicHttp thing, but seeing as there is significant To |
Beta Was this translation helpful? Give feedback.
-
Thanks @Chris--A - I'll try that out. When I first wrote the first version of my app, many moons ago, it was ESP8266 based I was obsessed with memory optimization and ended up writing my own string class (and later STL classes), after reading so many articles on how 'evil' Arduino's String class was (specially for non-transient operations and data duplication ops like concat()). With ESP32 I'm using std::string with allocated buffers but as you pointed out there are still String's lurking around in other libraries. |
Beta Was this translation helpful? Give feedback.
-
Yeah, the ESP8266 and ESP32 versions have been optimized for short strings to avoid allocations. I'm new to the ESP crowd, but have been an AVR/Arduino user for many years, and yes, I would never use However, I'm trying to use dynamic memory as little as possible so my app can safely run long term. Got an 8MB PSRAM version coming so that will be great. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Moving this to discussions |
Beta Was this translation helpful? Give feedback.
-
I ran some further benchmarking tests to see why PsychicHttp was using more heap memory than my original build on AsyncWebServer.
What's important to point out here is that my specific AsyncWebServer and AsyncTCP and not the original GitHub versions but very optimized over the years. The stack for example in AsyncTcp is 8192.
I used this repo's
benchmark
folder for the testing, stripping out everything except adding multiple server.ons() like:When a URI handler is registered, I see
That would explain with my 80 URI's PsychicHttp uses 12KB more heap memory.
The PsychicHttp code is clean and I don't see any areas for further optimization, so expecting this is all in the IDF.
I'll keep this open for now and report back any further findings.
Beta Was this translation helpful? Give feedback.
All reactions