Re-write the JsVar code such that instead of jsVars containing all your variables, it is actually a 'cache', with all variables actually stored in Flash.
Use jsvLock/jsvUnLock to load variables out of flash and stick them in the cache in RAM. On UnLock, write any changes to Flash (probably as a journal).
It's what Espruino was originally designed for (hence the lock/unlock), but I never had a need to implement it because all the flash on the MCU ended up being used up with Espruino itself.
However, an ESP8266 with 512k of free flash is a different prospect. Does it matter if it's not that fast if you can have effectively 512k of RAM.
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.
Just to add an option #3:
JsVar
code such that instead ofjsVars
containing all your variables, it is actually a 'cache', with all variables actually stored in Flash.jsvLock
/jsvUnLock
to load variables out of flash and stick them in the cache in RAM. On UnLock, write any changes to Flash (probably as a journal).It's what Espruino was originally designed for (hence the lock/unlock), but I never had a need to implement it because all the flash on the MCU ended up being used up with Espruino itself.
However, an ESP8266 with 512k of free flash is a different prospect. Does it matter if it's not that fast if you can have effectively 512k of RAM.