-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ESP32 - v1.21.0 slower than v1.20.0 running a large application #12609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you please try to quantify this somehow. How are you measuring this. When you say "it's slower" are we talking a few percent or are things taking twice as long. Ideally could you please post a code snippet that demonstrates this. Some small performance difference between releases is expected for ESP32 because it's quite sensitive to how the code is laid out in flash. The heap changes should actually be a performance improvement (due to improving GC times). IDF5 shouldn't make a difference for regular python code execution. |
Great. I don't give you this information because I wouldn't like to say a very wrong number and I still do not measure (with real tests) it. I just see by my eyes that are slowest. For example, I have a
Yes, that's why I wrote about number 2: "
That's small performance difference is not affecting me so much. My intention with this thread is just give you a feedback about this new version and maybe try to improve in the next version and share with others my experience, maybe someone have the same problem
Yes, I see that (new heap management) is a very big improve in performance on the I'm just giving you my first feedback (with nothing examples to prove that). Maybe that slowest by a problem in my code (application) and not in the Micropython, but why my code works faster on the the 1.20 than 1.21 I don't know. |
@beyonlo The problem is that without specifics I don't have a way to investigate this without spending a lot of time chasing random things and don't know whether this needs to be prioritised or not.
Exactly. There shouldn't be a reason that changing from one release to the next should cause your application to slow down if it's running the same Python code, regardless of what your code is doing.
Likely I'm not understanding what you're saying because I'm not following how you can visually tell a difference of 10-30% on something that happens 20 times per second. FWIW, here are the execution and network performance tests v1.20 release vs v1.21 release. Note that one thing that isn't tested here is flash read/write performance. Python execution performance:
Network transfer (over WiFi) for v1.20 (as server):
(as client)
Network transfer (over WiFi) for v1.21 (as server):
(as client)
|
Hi @jimmo
You are right. I will try to do many other tests
Yes, exactly. That's very strange because is the same Python code. I only changed the MicroPython version.
The I think that not means that problem is the my network application, because as my application does many other asyncio tasks "simultaneously": UART (RS-485), calculations, write files (rarely), etc, and one thread getting from the SPI sensors, some of those things can affecting the network task, and so on. Visually that responses over UART (RS-485) maybe slowest in the 1.21.0 too. I need to do real test here too.
That's great. Thank you for this report.
Following this, 1.21.0 has very same performance than 1.20.0 And by your reports the network performance on the WiFi (Client and Server) is faster on the 1.21.0 than 1.20.0. That's fantastic! Thank you very much for your time! |
Just my small tip: I had also sometimes a feeling ("impression") that after version changes my "application" got slower (mostly visible by slower http response times, as this is really the only important thing for me). The solution was clearing the complete memory, flashing the binary again and uploading the scripts again. Not sure if it has something with this that ESP32 is "quite sensitive to how the code is laid out in flash", but maybe... |
Hello @yunnanpl
Sorry, but is there a way to change from 1.20.0 to 1.21.0 without "clearing the complete memory, flashing the binary again and uploading the scripts again"? Like I wrote in my initial text, I'm using the official binary release 1.20.0 and 1.21.0 (not compiled by myself)
Could you please to tell us what exactly is the relation/means "dirty update" and "clean update" with this subject "change version 1.20.0 to 1.21.0"? Thank you! |
Hi @beyonlo,
This does not concerns the latest update in a special way, but it concerns any update I did since I use micropython. Sorry if this caused confusion ;) PS. I always use official binaries. |
@yunnanpl thank you to clarify. I always erase the flash before write a new micropython version.
So, that is not the problem, but new micropython version in real |
I did some more tests and I think that I found the problem. The UART/485 application is slowest in the 1.21.0 than 1.20.0, and as it is slow, all applications (other tasks) goes slow too, because UART/485 is using more time in the 1.21.0 to do the same job. That's not a final conclusion, so I will to do more tests to have a more secure results/answer. |
I am running my app on a Raspberry Pico W with a webserver (Microdot). With micropython v1.20 I have about 15KB more available memory than running the same application in v1.21. |
To be able to do anything with this, we really need a minimally reproducible code example. @maxi07 that does not seem to be related to the issue of the original reporter. |
Hi all
I have an application running on the
v1.20.0
(official .bin release - not compiled by myself) in myESP32-S3 (16MB Flash 2MB RAM)
. So I just flashed it with the newv1.21.0
(official .bin release) and I clearly noted that everything is slowest.v1.21.0
) was changed to theIDF-5
and was changed also how the heap management works py/gc & esp32: Add MICROPY_GC_SPLIT_HEAP_AUTO to automatically grow heap on esp32 #12141 - that are two big changes. Can be some of these changes made this new version slowest?Has anyone experimented the same problem with this new version?
Thank you very much
The text was updated successfully, but these errors were encountered: