On Wed, Jan 13, 2016 at 9:50 PM, Ben Pfaff <b...@ovn.org> wrote:

> On Tue, Jan 12, 2016 at 09:25:16PM +0200, Alexandru Ardelean wrote:
> > On Tue, Jan 12, 2016 at 6:23 PM, Ben Pfaff <b...@ovn.org> wrote:
> >
> > > On Tue, Jan 12, 2016 at 09:26:35AM +0200, Alexandru Ardelean wrote:
> > > > But as it turns out, OVS is getting bigger and bigger with each
> release,
> > > > which means fewer and fewer devices can support it.
> > >
> > > When I run "strip" on the version from master, the binary is about 2 MB
> > > (on i386).  For version 2.0.0, it was about 1.5 MB.  That's not very
> > > big, and not too much of an increase.
> > >
> >
> > I have about the same sizes for OVS.
> > And we use strip for builds on OpenWRT.
> >
> > Let me give a bit more context.
> > If it's too much email/info, I am sorry. I am trying to explain stuff as
> > best as I can.
> > The devices I'm referring to, have about 8 MB of flash.
> > I know this sounds a bit ridiculous (when viewed from a server class
> POV),
> > but it's a pretty common size among embedded devices, due to a price +
> cost
> > + type-of-flash+ volume-of-devices equation.
> > We also have devices with 256 MB flash, so those don't fit into this
> > discussion.
>
> How much does this commit trim from the binary size?
>

Atm I have a x86 OpenWRT build at hand to compare build sizes.
Spinning up a MIPS build may take while (1-2 hours due cross-toolchains
needing rebuild), but differences should be about the same
(percentage-wise).
The commit hash (from OVS trunk) is 98b94d1e7002063ce2ea3c3221fe9234cac4e124

Without the patch:
-rwxr-xr-x 1 user users  424552 Jan 13 17:54 libofproto.so.1.0.0
-rwxr-xr-x 1 user users 1681496 Jan 13 17:54 libopenvswitch.so.1.0.0
-rwxr-xr-x 1 user users  107916 Jan 13 17:54 libovsdb.so.1.0.0
-rwxr-xr-x 1 user users   21676 Jan 13 17:54 libsflow.so.1.0.0

With the patch:
-rwxr-xr-x 1 user users  420424 Jan 13 18:00 libofproto.so.1.0.0
-rwxr-xr-x 1 user users 1652536 Jan 13 18:00 libopenvswitch.so.1.0.0
-rwxr-xr-x 1 user users  107916 Jan 13 18:00 libovsdb.so.1.0.0
-rwxr-xr-x 1 user users   21676 Jan 13 18:00 libsflow.so.1.0.0

Roughly a 34k decrease in binary size, decrease being in libofproto and
libopenvswitch libs
Quite a small decrease, so more --disable-<feature> flags would be needed.
My next thought would have been to go after making RSTP and STP
disable-able.
And then after getting comfortable with the code, see how to organize the
code among libs.

Another idea that may be interesting, would be to try a micro-OVS spin-off
from the code-base of OVS.
I also thought about that ; but that's a bit more work than I have time for
atm. I might try it later.

The uOVS idea is borrowed from the libnl-tiny lib in OpenWRT which is ~30k
compared to ~450k which is libnl.
So you can have the most common libnl stuff working on devices with 2 MB of
flash, and 32 MB of RAM.
[ Obviously OVS on such devices is a bit crazy ]

But again, I don't want to push/insist on anything if it makes you guys
uncomfortable.
I did not think that --disable-<feature> approach would encounter much
resistance [since it's common among other projects].
I thought most of the comments I'd get would have been about how the code
is organized or styling.

Thanks
Alex
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to