• I'm loathe to give up the extra speed

    I think you may find that you don't actually end up losing much speed at all. Espruino's not that much slower than compiled/JIT when it comes to simple function calls - it's more when you get to loops and calling the same stuff over and over that it's not so great.

    Also while doing everything might be marginally faster, it's likely to be a lot slower at boot time when the compiled code has to be loaded into RAM from flash...

    So you're likely to make life a lot easier for yourself if you can figure out which bits are taking time and optimise just those :)

    One thing to add which might really help you - I guess you're using g.drawLine a lot? If you do: var dl = g.drawLine.bind(g); ... dl(x1,y1,x2,y2) then you'll allow Espruino to skip looking up drawLine on g for each draw call - which should save you a bunch of time for all code - JIT/compiled or even normal.


Avatar for Gordon @Gordon started