Yes, advanced optimisation works in small cases, but tends to optimise out a lot of Espruino functions which causes problems for anything sensibly sized.
I'd definitely recommend just simple optimisations. These work pretty well and don't require you to do anything special to your code. The main things are:
whitespace
optimising out unused values
inlining constants and collapsing maths - so myreg = C.ACCEL_ON|C.MAG_ON|C.GYRO_ON can just compile down to myreg=7 (as an example)
Also: I think that if you look in the console (via settings) you might be able to see what the code has minified down to - which could be some help?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes, advanced optimisation works in small cases, but tends to optimise out a lot of Espruino functions which causes problems for anything sensibly sized.
I'd definitely recommend just simple optimisations. These work pretty well and don't require you to do anything special to your code. The main things are:
myreg = C.ACCEL_ON|C.MAG_ON|C.GYRO_ON
can just compile down tomyreg=7
(as an example)Also: I think that if you look in the console (via settings) you might be able to see what the code has minified down to - which could be some help?