Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Binary size reduction - UPX
MHaggag:
Using upx, I've been able to reduce the binary size by half, from 8.42 Mb to 4.21 Mb:
--- Code: --- File size Ratio Format Name
-------------------- ------ ----------- -----------
292864 -> 103936 35.49% win32/pe codeblocks.exe
21504 -> 10752 50.00% win32/pe console_runner.exe
2043904 -> 666112 32.59% win32/pe codeblocks.dll
418304 -> 200704 47.98% win32/pe exchndl.dll
15960 -> 12888 80.75% win32/pe mingwm10.dll
6037465 -> 3426777 56.76% win32/pe wxmsw242.dll
-------------------- ------ ----------- -----------
8830001 -> 4421169 50.07% [ 6 files ]
--- End code ---
Might be a good idea to use upx in the build/packaging chain to reduce the package size. 56K users would be very thankful (Not me! :))
EDIT: Also, by linking to wxWidgets statically instead of dynamically, you guarantee that you only pull stuff you use. Are there any good reasons for using wxWidgets dynamically, aside from the INSANELY slow linking by gcc? (Last time I tried, it took half an hour to link wxWidgets statically into an application).
MHaggag:
--- Quote from: Muhammad Haggag on October 14, 2005, 08:12:35 pm ---EDIT: Also, by linking to wxWidgets statically instead of dynamically, you guarantee that you only pull stuff you use. Are there any good reasons for using wxWidgets dynamically, aside from the INSANELY slow linking by gcc? (Last time I tried, it took half an hour to link wxWidgets statically into an application).
--- End quote ---
Don't bother replying to this one. Most, if not all, plugins use wxWidgets, and thus the DLLs version is shared among them.
thomas:
UPX is a mighty fine tool, but do note a few things:
- The installer compresses the installation files. Compressing an already compressed file usually gains very little, rarely more than 3-5%. There is even the possibility that double-compression is worse than only compressing once (the same is true for many things, think for example of checksums or MACs).
- Decompression takes time and has other side effects, for example the executable memory image is no longer simply a memory mapped file that can be paged in and out "for free" (paging is never "free", but you know what I mean). An IDE is an application that is loaded, minimized, and maximized many times per day. Granted, UPX is fast, but I do nevertheless perceive it as noticeable for the IDE (only just, but still).
-exchn.dll and mingwm10.dll do not like being UPXed. I am surprised it works for you. UPX reliably breaks the versions of these libraries that come with RC2 and is not able to restore them (I tried that several times for this thread).
MHaggag:
--- Quote from: thomas on October 14, 2005, 08:44:49 pm ----exchn.dll and mingwm10.dll do not like being UPXed. I am surprised it works for you. UPX reliably breaks the versions of these libraries that come with RC2 and is not able to restore them (I tried that several times for this thread).
--- End quote ---
Ah, silly me. I've not actually tested it after compressing these 2 files.
Thanks for the reply.
takeshimiya:
You can actually choose less options when compiling wxWidgets dinamically, as the wxWidgets dll will be only used by the Code::Blocks vendor.
There are some things that are know to take a lot of space, namely TIFF support, ODBC support, exceptions, etc.
Also, compiling with other compiler that produces significant less size (Digital Mars, Borland, MSVC6).
See here: http://wiki.wxwidgets.org/wiki.pl?Reducing_Executable_Size
Navigation
[0] Message Index
[#] Next page
Go to full version