You are reading a single comment by @Gordon and its replies.
Click here to read the full conversation.
-
the function is executed from flash
Am I understanding it right? A function is loaded into from flash into RAM line by line while executed? Or is loaded as a whole and then executed and then unloaded? Or CPU is capable to work with flash same as with RAM just slower?
Please do not reply. I am reading https://www.espruino.com/Performance
If you upload modules with the IDE (or use the app loader to do it) by default they will be minified.
If you use that method, when
require
d the modules do use up some RAM, but only enough to hold the declarations for every function that you export or that is defined at module scope. So... if your module just exports a single function but that function is huge, the RAW usage will actually be very low and the function is executed from flash.