or does it matter at that point since either way it's in RAM? Or is it in RAM?
:) As you say, var image = require("Storage").read("image.img"); just gives you a 'pointer' to the data in Flash memory, so it's not actually in RAM.
However, while it is slower than RAM, it's still a lot faster than using require("Storage").read directly, since it's not having to scan the filesystem to find the file each time.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
:) As you say,
var image = require("Storage").read("image.img");
just gives you a 'pointer' to the data in Flash memory, so it's not actually in RAM.However, while it is slower than RAM, it's still a lot faster than using
require("Storage").read
directly, since it's not having to scan the filesystem to find the file each time.