Community
Participate
Working Groups
Actually a lot of flash space is used by the lua source files and non-stripped binaries. At the end of the build, it would be great to be easily able to compress the file (stripping comments, white-space etc..) and stripping binary files. As a common use case a doc or an integration in the build system would be nice.
Work in progress. Building the project using "-Os" and "-s" CFLAGS reduces the runtime size from 3 Mo to 2.2 Mo. Apparently, some libs are linked statically, we can improve this part. I will investigate.
Cool! Would be nice to remove comments & extra whitespaces from Lua source files too, AFAIR it can save a lot of space (think of all the EPL headers in all the files!) I used to use this basic regexp (which probably can mess up the sources in some cases ;-)) find . -type f -name '*.lua' -print0 | xargs -0 sed -i '/^[ \t]*--/d'
Finding, listing, documenting all the ways to reduce "flash" usage is definitely something we need to do. However, what I am not sure about is the final expectations here: for example I wouldn't reduce debug infos provided by the "default" cmake target settings, especially for the Lua files content. I would rather provide very precise commands to achieve every ways to reduce flash usage. To make that "out of the box" I would rely on Cmake settings. Cmake comes with build profiles/types: http://www.cmake.org/cmake/help/v2.8.0/cmake.html#variable:CMAKE_BUILD_TYPE I think we could configure MinSizeRel profile to do everything we've found to reduce flash usage. We should also discuss this topic in a Wiki page, giving example how to force this Cmake build profile. But I would leave our "default" Cmake target settings to use the current settings. Does that sounds good to you guys?
(In reply to comment #3) > I think we could configure MinSizeRel profile to do everything we've found > to reduce flash usage. > [...] > Does that sounds good to you guys? Yup. +1 for putting these settings in the MinSizeRel profile. Makes much sense.
Fixed with commit http://git.eclipse.org/c/mihini/org.eclipse.mihini.git/commit/?id=b15ace6ac6f432c32f7b96b531f3322e47294f8b I have also updated the README.md. Steps for using this feature : $ git pull $ bin/build.sh -m Enhancement is around 56% here for x86_64 (3 MB -> 1.7 MB). However depending on the toolchain and the target used, it be might different in size.
Well... that's not 56% (my bad) but enhancement is good anyway :D
Another enhancement might be compressing Lua modules with an lzma compressor and patch the Lua VM to uncompress these modules on the fly. However, it requires a lot of work, and change a standard Lua VM to do that is not really recommended, imho. Improvement is left for future discussions...