Micropython is faster than MMBasic :-(


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11848
Posted: 01:51pm 24 Jul 2026      

One of my favourite benchmarks is the calculation of the solar eclipse.

solar_eclipse.zip

The data I use to test with is:
12,1,2000
39,40,36
-104,57,12
1644
30


Running on a HDMI build at 378 MHz this takes 13.23 seconds

Converting this to Micropython 1:1

solar_eclipse_py.zip

This runs in 8.77 seconds at 378MHz!

but Micropython has a trick up its sleeve using the ulab library

solar_eclipse_ulab.zip

And now it runs in 7.44 seconds

For reference if I run the Basic code on a 480MHz STM32H743 which has H/W double precision floating point it takes 7 seconds