simonkrauter/NiGui

Binary sizes much smaller than stated in FAQ

bkauler opened this issue · 2 comments

Quoting from FAQ:
Sizes of "example_01_basic_app":
Linux x64 binary: 608 kB

However, with a little bit of optimization and stripping, I get 127KB for a x64 Linux binary. For example_02_controls, 135KB.

I compiled like this:

# nim c -d:release --opt:size -d:useMalloc --mm:orc --passC:-flto --passL:-flto --path:../src example_02_controls.nim

When I first looked at NiGui, that 608KB turned me off. So I went elsewhere. Came back later and decided to confirm binary size for myself.

Binary size could be further reduced if you have the option of generating the widget wrappers as a shared library. Then, if a Linux distribution has a few GUI apps written in NiGui, the total size will be very low.

I am just getting started with Nim, and only yesterday started looking at GUI toolkits. I posted to my blog about the "ui" module:

https://bkhome.org/news/202208/ui-gui-toolkit-for-nim.html

The ui example binary is only 27KB, the shared library 187KB.

When I first looked at NiGui, that 608KB turned me off.

On which tiny micro-controller do you want to run a GUI app?

Yes, the numbers should be updated. On my linux system the example_01_basic_app is now 407 kB.