You are reading a single comment by @MaBe and its replies. Click here to read the full conversation.
  • Let me use this snippet and make the difference visible with process.memory().

    • no optimization

      process.memory();
      ={ free: 1267, usage: 333, total: 1600, history: 170,
      gc: 0, gctime: 1.862 }

    • module uploaded as function

      process.memory()
      ={ free: 1265, usage: 335, total: 1600, history: 170,
      gc: 0, gctime: 1.862 }

    • use module from flash

      process.memory()
      ={ free: 1357, usage: 243, total: 1600, history: 60,
      gc: 0, gctime: 1.874 }

    • freeHeap is for all cases 11736

    how many vars you save depends on the size of the module .
    Running SH1106 from storage saves round about 90 vars.

    That should justify the extra effort ;-)

    ESP8266_4MB board has now 48 pages to store any stuff you like, check the build content

    Hint: At the moment storage is only working for the first segment, read issue #1507

    Why not write a script as workaround until someone adds this feature into the WebIDE or command line tool

    • scan modules in source file
    • create a min version of the modules of not exist
    • create a store_modules.js
    • upload store_modules.js
    • upload source and you are done.


About

Avatar for MaBe @MaBe started