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

About

Avatar for Gordon @Gordon started