You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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...

    • The pyboard has twice the clock speed - 168MHz vs 84MHz
    • Micropython compiles to bytecode first (sometimes even native code), whereas Espruino interprets from source - which really hurts performance. You could try E.setFlags({pretokenise:1}) at the start of your code to give you a bit of a speed boost though.
    • JavaScript uses 64 bit floats for all numbers, which the built-in floating point unit in these chips is useless for - so it's all done in software. If Python uses 32 bit floats it'll have a huge advantage (but it may not be).

    @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.

  • Hi, what my test above shown on the pico with some floats at least for pi computation, is:

    1. uncompiled and not pretokenised: 446 s
    2. compiled (84 MHz) : 36 s as opposed to ThomasChr result of 28 s on the pyboard (168 MHz)

    I did not tried the tokenised functionnality.
    Results are indeed in favor of Espruino Pico as it is only 84 MHz clocked.

    This test could be rerun on Espruino Pico reflashed with Micropython as it has been ported to.
    Porting Espruino to the Pyboard would eventually and symetricaly allow this comparison running on the Pyboard too
    That would definitly be fair.

About

Avatar for Gordon @Gordon started