You are reading a single comment by @maze1980 and its replies.
Click here to read the full conversation.
-
is the same size as
var data; data.set(read(register, length));```
This function is used quite often in the examples:
https://www.espruino.com/Reference#l_ArrayBufferView_set
Looks like I2C.readFrom already returns an Uint8Array, so I think you are doing a double allocation.
Not sure, but I think your memory usage might be smaller with just:
Or not, or might not even be measurable, if that allocation is just in a small function, and the GC frees up memory...