As the title says... Chat on...

User avatar
By Markus Gritsch
#6546
yes8s wrote:Note: The request is still open, if anyone who has can compile successfully, to report on what memory saving can be made by deselecting modules from compilation ;)

I quickly set up a build environment on Windows. When building unmodified NodeMcu I get
Code: Select all> = node.heap()
20736


With
Code: Select all#define LUA_USE_MODULES_NODE
#define LUA_USE_MODULES_FILE
#define LUA_USE_MODULES_GPIO
#define LUA_USE_MODULES_WIFI
#define LUA_USE_MODULES_NET
// #define LUA_USE_MODULES_PWM
// #define LUA_USE_MODULES_I2C
// #define LUA_USE_MODULES_TMR
// #define LUA_USE_MODULES_ADC
#define LUA_USE_MODULES_UART
// #define LUA_USE_MODULES_OW
// #define LUA_USE_MODULES_BIT

I get
Code: Select all> = node.heap()
21688

So about 1k is gained.
User avatar
By yes8s
#6551
Markus Gritsch wrote:
yes8s wrote:Note: The request is still open, if anyone who has can compile successfully, to report on what memory saving can be made by deselecting modules from compilation ;)

I quickly set up a build environment on Windows. When building unmodified NodeMcu I get
Code: Select all> = node.heap()
20736


With
Code: Select all#define LUA_USE_MODULES_NODE
#define LUA_USE_MODULES_FILE
#define LUA_USE_MODULES_GPIO
#define LUA_USE_MODULES_WIFI
#define LUA_USE_MODULES_NET
// #define LUA_USE_MODULES_PWM
// #define LUA_USE_MODULES_I2C
// #define LUA_USE_MODULES_TMR
// #define LUA_USE_MODULES_ADC
#define LUA_USE_MODULES_UART
// #define LUA_USE_MODULES_OW
// #define LUA_USE_MODULES_BIT

I get
Code: Select all> = node.heap()
21688

So about 1k is gained.


Is that all :( Damn... I was hoping would be closer to 5k. Many thanks for doing this. I hope it helps others too.

Note: Was this with latest 0.9.5 firmware?
I think nodemcu team have migrated to lubuntu vm now. I also believe some of the current memory gains are due to compiler change...
User avatar
By Markus Gritsch
#6555
yes8s wrote:Note: Was this with latest 0.9.5 firmware?
I think nodemcu team have migrated to lubuntu vm now. I also believe some of the current memory gains are due to compiler change...


Yes, latest firmware. Latest pre-build version is compiled with gnu toolchain. Current memory gains are due to code optimizations.