Float Speed Espruino Pico VS Pyboard #5841
Replies: 1 comment
-
Posted at 2017-12-23 by PaddeK In my opinion you really can't compare hardware if you have to use different languages. Right now the test is maybe telling more about the advantages of python then about the floating point capabilities of the underlying hardware. Posted at 2017-12-23 by asez73 Hello, you could have a look at this http://forum.espruino.com/conversations/265821/ . Also micropython is compiled in bytecode so, that's not really fair per opposition to fully interpreted approach of espruino: you can have dynamically written code in strings and then convert them to executable code on the fly. Dig a bit in this forum. Posted at 2017-12-23 by asez73 The wipy 1.0 has no floating point at all and that's a micropython supported board. Posted at 2017-12-23 by asez73 Just now, I am testing this with a "compiled" directive.
So there is a speedup of a factor 12 to using the "compiled" directive.
Posted at 2017-12-23 by @gfwilliams Yes - the Python interpreter in the Pyboard is significantly faster - Espruino was designed for much more constrained devices, so cares more bout memory usage and less about outright speed. You're seeing a whole bunch of differences here...
@AseZ using compiled code, all integer code will be very fast - however for floating point it falls back to Espruino's built-in maths library (because of the hassle of linking in all the double maths functions), so it'll suffer a performance hit too. However it looks like clock-for-clock JS code with the compiled directive is still faster than standard MicroPython, which I'm pretty happy about. If you did a purely integer benchmark I imagine compiled JS would give you some really impressive figures. Posted at 2017-12-24 by asez73 Hi, what my test above shown on the pico with some floats at least for pi computation, is:
I did not tried the tokenised functionnality. This test could be rerun on Espruino Pico reflashed with Micropython as it has been ported to. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-12-23 by ThomasChr
Hello Forum,
this little test may neither be fair nor exact but i still wonder about the outcome...
The Leibniz Formula is a little float Problem for calculating Pi.
I wrote the code in Python and Javascript and let it run on the PyBoard and the Espruino Pico.
Here‘s the Python-Code:
And here‘s the „same“ in Javascript:
On the PyBoard the code took 26 seconds to execute, the Pico took 458 seconds.
I‘m a little puzzled of the outcome because I though both boards have floating point hardware, or am I wrong?
Can anyone explain the massive speed difference to me?
Thomas
PS: I know that this synthetic benchmark has nothing to do with overall speed, I just want to understand why these numbers are what they are in this particular case.
Beta Was this translation helpful? Give feedback.
All reactions