NiGui icon indicating copy to clipboard operation
NiGui copied to clipboard

Binary sizes much smaller than stated in FAQ

Open bkauler opened this issue 1 year ago • 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.

bkauler avatar Aug 29 '22 23:08 bkauler

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

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

theAkito avatar Aug 30 '22 00:08 theAkito

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

simonkrauter avatar Aug 31 '22 01:08 simonkrauter