|
Boost Users : |
Subject: Re: [Boost-users] Boost.MSM: Executable size
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2013-01-08 17:18:12
Hi,
> Hi all,
>
> I'm using boost.MSM for a productive embedded system. My concern is, that
> my
> compiler produces a
> executable size of all most 2MB for a state machine consisting of 4
> sub-machine and nearly 40 transition for the complete state machine, but
> with no action and guard code.
>
> My compilation system is as follows:
>
> - eclipse juno
> - mingw 4.7.0
> - Compiler settings for the release of the binary are: "-O3 -Wall -c
> -fmessage-length=0"
>
> Is this a good size or should I be worried about this nearly 2 MB for the
> release executable?
No idea, it depends on your configuration, what you link with,etc.
But from what I saw, yes, gcc is generating much bigger executables than,
say, VC.
> I'm asking as like stated in
> http://www.boost.org/doc/libs/1_52_0/libs/msm/doc/HTML/ch04s02.html
> <http://www.boost.org/doc/libs/1_52_0/libs/msm/doc/HTML/ch04s02.html>
>
> the executable size for a good sized state machine could reach a size of
> almost 600kB, and my state machine is still not finished (50 % more code
> has
> to be added for further submachine...)
>
> Using the "-Os" produces a executable size which is almost 20% smaller as
> with the "-O3".
>
> In case I compile the state machine with the default debug level (-g) the
> binary is allmost 35MB big....
You should in any case strip (-s), it will be better, but still bigger than
VC.
This is a more general gcc compiler and template issues and I'm not a
specialist.
> Best regard,
>
> RaRi
Regards,
Christophe
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net