NotesGordon20170224.txt Fri 2017.02.24 WebIDE v0.69.5 Flashing from a Windows 10 Home ver 10.0.14393 Build 14393 laptop running Chrome ver 56.0.2924.87 Firefox ver 51.0.1 WebIDE ver 0.65.9 Gordon, As you requested examples to view, here are the current source files. While this certainly is of low priority, it still piques the curiousity meter and thought you might find value here. The following source files make up this demo. NotesGordon20170224.txt code20170206ESP8266FileServer.jsSTART.js code20170206ESP8266FileServer.jsPASS1.js code20170206ESP8266FileServer.jsPASS2.js code20170206ESP8266FileServer.jsPASS3.js Trying to repeat this was a bit tedious. But retracing my deletion order the best I could, came up with a similar scenario. Removing a 4K chunk, reset() and 'Send to Espruino' then save() resulted in a reduction of 18 bytes. 11902 - 11884 Removing another 2K chunk actually increased the final size by 248 bytes. 11884 - 12132 I was unable to duplicate the increase when I got the final size below 900 jsvar blocks. I only wish I could have duplicated the larger changes of 500-1000 bytes when removing 3K chunks of both internal comments and obsolete wrapper functions. In any event, these files should show the increase in bytes as the file size decreases. Using 1v89 as I'm still not able to flash this ESP8266-12 with 1v91 http://forum.espruino.com/conversations/300154/#comment13481959 Usage value of 25 or 27 after a reset() why not the same each time? Sending the same file resulted in different compression results, even when not changing the source file. Why? I understand that you may not want prying eyes here so, Feel free to contact me via email should you need additional information. I'll assist the best I'm able. Robin Had a thought, could it be in the amount of vertical whitespace that is removed? This seems to be the tricky part in consistent number of lines removal, where the whitespce boundries are. Attempting to learn the Wifi class functions using @MaBe source as a foundation. This is the source file that seems to play havoc with the total byte counter during a save() I was working on the wifi.scan function sc() and cleaning up internal comments when I noticed the byte count increase which still prevented a save() What I did: reset() First note the bytes attempted to be saved before the compression Then remove the embedded comments from function ~[L950] function onPageRequest(req, res) { and the four functions that reference unavailable functions in 1v89 Note: Not available in 1v89 ~[L500] function sip4() { Send To Espruino Initial byte count ERROR: Too big to save to flash (14648 vs 12284 bytes) Compressed 27200 bytes to 11902 After removal of ~300 lines of code - byte count jumps up after deleting ~3000 chars ERROR: Too big to save to flash (16264 vs 12284 bytes) Compressed 27200 bytes to 12132 process.memory() See PASS2 below where resultant file jumps from 11884 bytes to 12132 bytes after removing comments 248 byte increase code20170206ESP8266FileServer.js 30K code20170206ESP8266FileServer.jsSTART.js 30K 1200 lines of code reset() 1v89 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xe0 chip 0x4016 >process.memory() ={ "free": 1673, "usage": 27, "total": 1700, "history": 0 } > >process.memory() ={ "free": 311, "usage": 1389, "total": 1700, "history": 80 } >save() =undefined Erasing Flash..... Writing................. ERROR: Too big to save to flash (14704 vs 12284 bytes) Deleting command history and trying again... Erasing Flash..... Writing................ ERROR: Too Running onInit()... Note that onInit() fires before writing is complete Remove internal comments and four functions code20170206ESP8266FileServer.jsPASS1.js 26K 1093 lines of code function onPageRequest(req, res) { function joinWifi4() { function status() { >process.memory() ={ "free": 482, "usage": 1218, "total": 1700, "history": 433 } >save() =undefined Erasing Flash..... Writing................... ERROR: Too big to save to flash (16484 vs 12284 bytes) Deleting command history and trying again... Erasing Flash..... Writing.............. Compressed 27200 bytes to 11902 reset() and just resending the file results in 39 fewer bytes despite the same file!! >process.memory() ={ "free": 482, "usage": 1218, "total": 1700, "history": 431 } >save() =undefined Erasing Flash..... Writing................... ERROR: Too big to save to flash (16445 vs 12284 bytes) Deleting command history and trying again... Erasing Flash..... Writing.............. Compressed 27200 bytes to 11884 Checking... code20170206ESP8266FileServer.jsPASS2.js 24K 1026 lines of code function pageHandler(req, res) { external comments around ~L400 >process.memory() ={ "free": 520, "usage": 1180, "total": 1700, "history": 456 } >save() =undefined Erasing Flash..... Writing................... ERROR: Too big to save to flash (16781 vs 12284 bytes) Deleting command history and trying again... Erasing Flash..... Writing.............. Compressed 27200 bytes to 12132 Checking... Remove most all internal comments code20170206ESP8266FileServer.jsPASS3.js 19K 0885 lines of code >process.memory() ={ "free": 772, "usage": 928, "total": 1700, "history": 684 } >save() =undefined Erasing Flash..... Writing.................. ERROR: Too big to save to flash (15593 vs 12284 bytes) Deleting command history and trying again... Erasing Flash..... Writing............ Compressed 27200 bytes to 9233 Checking... [eof]