You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I'm pleased to announce Espruino 2v16

    This one adds some really decent performance improvements:

    Interpreter speed improvements

    After some careful analysis of the assembly, I managed to make a few tweaks to the interpreter. It's now around 12% faster, and smaller too.

    A simple 'mandelbrot' test that took 6.5s to execute on 2v15 now takes 5.8s on 2v16

    Bangle.js

    Fixes/Improvements

    • Fixed hang at boot that could be caused is Storage was corrupted in just the wrong way
    • Stopped the user breaking out of flash erase/compact commands - this should really help with corruption issues
    • Added option in settings to allow for left-handed wearers
    • Built-in touchscreen calibration in settings app
    • Compass heading now reported in the correct direction (apps changed to account for this)

    Performance

    • Massive Bangle.js 2 graphics fill improvements (6-12x faster)
    • LCD now updates 'in the background' while JS code is running
    • Flash erase can use 64k/all clear command to erase blocks much faster
    • support for Bangle.setUI({remove:...}) - Clocks/Launchers like the defaults that define this and implement it properly can now 'fast switch' to the launcher and back, which makes the experience of using a Bangle much snappier!

    JIT interpreter improved and added to MDBT42Q/Pixl.js/Puck.js/Bangle.js 1 & 2

    You can now tag functions with "jit" and they will be jit-compiled on the device. There's a relatively small subset of the language supported so it can't be used for everything, but it can really make a difference in some situations, especially if you just need to toggle some IO or munch through some data:

    var data = new Uint8Array(1000);
    for (var i=0;i<data.length;i++) data[i]=i;
    
    // Normal JS
    t=getTime();data.forEach(function (d) {
      digitalWrite(LED,d&1);
      digitalWrite(LED,d&2);
      digitalWrite(LED,d&4);
      digitalWrite(LED,d&8);
      digitalWrite(LED,d&16);
      digitalWrite(LED,d&32);
      digitalWrite(LED,d&64);
      digitalWrite(LED,d&128);
    });print(getTime()-t); // 2.83 sec 2v15,  2.61 sec 2v16
    
    // Compiled server-side with GCC
    function writeLEDs(d) {"compiled"
      digitalWrite(LED,d&1);
      digitalWrite(LED,d&2);
      digitalWrite(LED,d&4);
      digitalWrite(LED,d&8);
      digitalWrite(LED,d&16);
      digitalWrite(LED,d&32);
      digitalWrite(LED,d&64);
      digitalWrite(LED,d&128);
    }
    t=getTime();data.forEach(writeLEDs);prin­t(getTime()-t); // 1.30 sec
    
    // New, JIT
    t=getTime();data.forEach(function (d) {"jit"
      digitalWrite(LED,d&1);
      digitalWrite(LED,d&2);
      digitalWrite(LED,d&4);
      digitalWrite(LED,d&8);
      digitalWrite(LED,d&16);
      digitalWrite(LED,d&32);
      digitalWrite(LED,d&64);
      digitalWrite(LED,d&128);
    });print(getTime()-t); // 0.95 sec - > 2.5x faster!
    

    It's still early days so your mileage may vary, but it's another useful tool if you just need to output data quick or do some calculations.

    Other changes

    • Simple arrow functions like () => {...} now use one variable less than before
    • E.HSBtoRGB can now be called with E.HSBtoRGB(h,s,b,16) to return a 16 bit value suitable for Bangle.js
    • Many ESP32 Bluetooth LE central mode improvements - ESP32 can now scan and connect to other devices (for example with Nordic UART) using the exact same code/API as the offical Espruino BLE devices

    Puck.js now has a 'minimal' build with more memory dedicated to Flash storage - This strips out the more niche features (like ESP8266 Wifi support) and allows you to use the storage freed for your data - great for data logging. This was released silently in 2v14, but it deserves a mention here!

    ... and there's more! Check out http://www.espruino.com/ChangeLog for more info!

About

Avatar for Gordon @Gordon started