[Haskell-beginners] Haskell exectuable size

Henk-Jan van Tuyl hjgtuyl at chello.nl
Tue Sep 3 13:48:17 CEST 2013


On Tue, 03 Sep 2013 12:45:34 +0200, Nathan Hüsken  
<nathan.huesken at posteo.de> wrote:

> Hey,
>
> I have written a small wxHaskell application. Since wxWidgets seems to  
> be required to be linked dynamicly, I have to add the wxWidgets dlls.  
> Those make a total of about 25MB, wow.
>
> Now the compiled exe (compiled with ghc -O2) has size 15MB.
> In total I am at about 50Mb, which is just to much.
>
> Why is the exe so big?
> Has anyone a suggestion on how to reduce the total size?

The compiled wxcore library (the raw wxWidgets interface) is about 11 MB.  
You can reduce it by about 50%, by using the GHC option -optl-s (this  
passes the option -s to the linker) to remove the debug data from the  
executable. This works for all executables, not just wxHaskell users.

The size can further be reduced by running UPX[0], an executable  
compression utility. UPX can also be used to compress DLLs.

Regards,
Henk-Jan van Tuyl


[0] http://upx.sourceforge.net/


-- 
Folding at home
What if you could share your unused computer power to help find a cure? In  
just 5 minutes you can join the world's biggest networked computer and get  
us closer sooner. Watch the video.
http://folding.stanford.edu/


http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--




More information about the Beginners mailing list