• It's just that if you request a web page that has 10KB in it, you might need ~6-7KB just for that

    Is there any way of getting that down? It seems a bit extreme when we only have 12k for all our other code and variables, and when we're only dealing with ~500 byte packets of data anyway.

    Espruino is designed not to use malloc - so from my point of view, trying to abuse it in order to use malloc to store the data it needs sounds like a really bad idea.

    To stick with what it's good at, it'd be much better to try and allocate buffers within the statically allocated Espruino memory, and to expand the amount that was statically allocated.

    code loaded by the IDE needs to fit into JSvars 2 times: once for "real" and once for history.

    As @DrAzzy says, history gets flushed as soon as memory gets low.

    anonymous functions are evil from a space perspective

    There's an issue open for that in GitHub - it might be possible to store a link to the original function code, and an offset within it.

    However, what then happens in:

    var a = (function() {
      // blah blah blah
      return function() {
      };
    })();
    

    There's going to have to be code that detects when the outer function disappears, and that then splits up the string.

About

Avatar for Gordon @Gordon started