I'm not sure that allocating variables globally is of help since locals are searched first when interpreting the code... if of course depends on how many other locals and globals are around. I understand where the though is coming from: allocation and deallocation work can may be skipped... on the other hand for instance garbage collection, any reference in a scope does something when 'entering and leaving' the scope... may be it is less of housekeeping.
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.
I'm not sure that allocating variables globally is of help since locals are searched first when interpreting the code... if of course depends on how many other locals and globals are around. I understand where the though is coming from: allocation and deallocation work can may be skipped... on the other hand for instance garbage collection, any reference in a scope does something when 'entering and leaving' the scope... may be it is less of housekeeping.