You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • If you're writing binary data into a file with an offset, you need to tell Espruino the size of the file you want first so it can allocate space - see https://www.espruino.com/Reference#l_Storage_write

    What you were doing storing individual files for acceleration data looks good - I guess it's just the hit of loading the data back.

    One thing you might want to consider is to encode the arrays as base64 and put that in JSON with btoa(accelx.buffer) and then new Int16Array(E.toArrayBuffer(atob(str))).

    The reason is that Espruino stores arrays way more efficiently in IntXArrays, but when you write to JSON it has to convert those arrays into normal JS arrays, which use a lot more memory. If you write as base64 it avoids all that and will load everything far more efficiently.

About

Avatar for Gordon @Gordon started