I've been playing around with µPython on ESP32 for a while now. Two things to note: Version 1.18 of µPython is 2-3x as fast as previous versions. Secondly, the 'viper' code emitter is about 10x as fast as interpreted code if you're doing any sort of math in a loop. Just check the chapter of the µPython manual on optimization. Finally, I was able to get native compiled modules working with very little trouble, so you can drop down to code that will perform identically to the Arduino if necessary. That all said, if you're using the ESP32 to perform one, straightforward task that's at all performance sensitive, it makes sense to just use Arduino. But the ESP32 has SO many capabilities packed into it it's pretty easy to come up with uses for it where if you can spare the CPU cycles, you can throw together a complicated system with µPython that performs more than adequately. Arduino (C++) and Python are pretty much on the opposite sides of each other in terms of performance, complexity and ease-of-use, which makes this comparison interesting. I wish there was a solution that lands in the middle (maybe golang?), but I don't see anything that's mature yet.
Thanks! At this speed difference is not a big deal since the difference in performance is huge, but usually you would like to run your loops a few thousand times and calculate average, min, max, and std dev of the full runs for a more detailed comparison.
Is there a way to take the interpreted language and pre-compile it? I think with BBC Basic you could run as an interpreted language but there was also a away that could be compiled, and a lot of programs used this method apparently. BBC Basic was already quick as it was.
I try to use Thonny for ESP32 but I get this message Device is busy or does not respond. Your options: - wait until it completes current work; - use Ctrl+C to interrupt current work; - reset the device and try again; - check connection properties; - make sure the device has suitable MicroPython / CircuitPython / firmware; - make sure the device is not in bootloader mode. esptool installed by default and I installed the firmware and all the time the same message comes. Do you know how to fix this one?
so.. you want me not to learn python and learn c++.. such comparison are just for this kind of thoughts.... While I've completed my first complete robotic arm in python... :'(
I've been playing around with µPython on ESP32 for a while now. Two things to note: Version 1.18 of µPython is 2-3x as fast as previous versions. Secondly, the 'viper' code emitter is about 10x as fast as interpreted code if you're doing any sort of math in a loop. Just check the chapter of the µPython manual on optimization. Finally, I was able to get native compiled modules working with very little trouble, so you can drop down to code that will perform identically to the Arduino if necessary.
That all said, if you're using the ESP32 to perform one, straightforward task that's at all performance sensitive, it makes sense to just use Arduino. But the ESP32 has SO many capabilities packed into it it's pretty easy to come up with uses for it where if you can spare the CPU cycles, you can throw together a complicated system with µPython that performs more than adequately. Arduino (C++) and Python are pretty much on the opposite sides of each other in terms of performance, complexity and ease-of-use, which makes this comparison interesting. I wish there was a solution that lands in the middle (maybe golang?), but I don't see anything that's mature yet.
You can run Rust on the pico, though I don’t know what the library support is like.
Thanks! At this speed difference is not a big deal since the difference in performance is huge, but usually you would like to run your loops a few thousand times and calculate average, min, max, and std dev of the full runs for a more detailed comparison.
Thank you for this! I'd been wondering about it for a few weeks now
Me too. Thanks. Good stuff.
i tested with a button to trigger one servo and one led, both with Micropython and Arduino, man, Arduino is way way faster
i guess it's the same tradeoff as on a pc, speed of developement vs speed of execution
Is there a way to take the interpreted language and pre-compile it? I think with BBC Basic you could run as an interpreted language but there was also a away that could be compiled, and a lot of programs used this method apparently. BBC Basic was already quick as it was.
Cython is a new way but I have yet to explore it
I try to use Thonny for ESP32 but I get this message Device is busy or does not respond. Your options:
- wait until it completes current work;
- use Ctrl+C to interrupt current work;
- reset the device and try again;
- check connection properties;
- make sure the device has suitable MicroPython / CircuitPython / firmware;
- make sure the device is not in bootloader mode.
esptool installed by default and I installed the firmware and all the time the same message comes. Do you know how to fix this one?
If I remember, I did a ctr C or just unplugged it and plugged it back. Turn off the ESP32 too. Are you running the boot loader?
@@TJMoir I pressed Carl+c many times, turned off the ESP32 and no thing changed. It works with Arduino IDE but not with Thonby!
so.. you want me not to learn python and learn c++.. such comparison are just for this kind of thoughts.... While I've completed my first complete robotic arm in python... :'(
Up to you. Just saying that Python is much faster if speed is an issue. Many applications where it isn't
@@TJMoir you meant c?
@@suryajayaweera c c++ on Arduino environment