Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TIP - Shrinking Openoffice
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message

Joined: 21 Jun 2004
Posts: 29
Location: Maine

PostPosted: Thu Sep 14, 2006 1:01 am    Post subject: TIP - Shrinking Openoffice Reply with quote

Howdy all,

I'm sure I'm not the only one to do this, but I wanted to share my experiences just in case.

I'm a fan of the -Os flag for compilation. I don't use it on everything, but I like Linus' approach - use O2 for things like the kernel, and use Os for applications, especially large, bloated apps like Openoffice.

The trick with Openoffice is that it turns off -Os by default. In the ebuild, you'll see that -Os is replaced with -O2. However, it is easy to edit the ebuild and change it so that -Os is the default. You'll have to recreate the digest after this by:
ebuild openoffice-version.ebuild digest

I've never had a compile error doing this. Why do I do this, do you ask? OpenOffice works fast enough for me (I can't out-type it), but those load times - ouch! Reducing the size means reducing the load times, and the hard drive is a much more noticeable bottleneck than a few missed optimizations for the CPU (in this case).

Does it work? Well, I've never ran tests with a stopwatch, but it sure feels like it loads faster. I also notice that my -Os binary (when I emerge with -b option to create a package for the rest of the lab) is about 40 MB smaller than the standard openoffice-bin package. Now, maybe openoffice-bin includes things that my build doesn't, I don't know. What I do know is my openoffice is about 40 MB smaller, and it FEELS like it is loading much quicker (placebo effect - maybe, maybe not). If it didn't take 1000 years to compile, I'd compile a -Os and a -O2 version and benchmark them. However, that's a bit too painful, so I'll go with the gut and say it loads faster.

Anywho, I thought I'd pass that along. -Os performs a large percentage of the -O2 optimizations, AND reduces file size. It won't always be just as fast as -O2 (sometimes it is), but for big programs like Openoffice, I think you'll find improved load times / reduced bloat outweighs any CPU gains of -O2.

There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.
Back to top
View user's profile Send private message
Retired Dev
Retired Dev

Joined: 08 Jul 2004
Posts: 399
Location: Stockton, CA

PostPosted: Thu Sep 14, 2006 2:12 am    Post subject: Reply with quote

Have you considered contacting the maintainer and finding out why they disabled -Os on this? I'm somewhat curious myself. Generally, flags are 'dumbed down' if they're not -O1 or -O2. -Os is not used very often, so it generally is not taken into consideration. I'd check and see.. maybe search bugzilla and post an ehancement but stating your findings.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum