Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CFLAGS and large applications
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mntnoe
n00b
n00b


Joined: 21 Jan 2007
Posts: 61
Location: Denmark

PostPosted: Tue Jun 05, 2007 3:27 pm    Post subject: CFLAGS and large applications Reply with quote

I want to try out compiling firefox and openoffice with the -Os flag to decrease load time, as I have a laptop with a slow harddisk.

What is your general experience with that flag on large applications? Thinking of responsiveness and such.

What is the recommended way of setting application specific CFLAGS (like using /etc/portage/package.use for USE-flags)?

Any other way to optimize applications for slow harddisks?

Thanks in advance.
Back to top
View user's profile Send private message
neysx
Retired Dev
Retired Dev


Joined: 27 Jan 2003
Posts: 795

PostPosted: Tue Jun 05, 2007 3:38 pm    Post subject: Reply with quote

I also compile those two with -Os, not because of slow disks, but because -Os gives better performance overall on my dual AMD MP system.
For firefox, you need to edit /usr/portage/eclass/mozcoreconf.eclass to allow -Os (same as for -O1).
For OO.o, you need to edit the ebuild to remove the line that filters -O? and redigest it.

Hth
Back to top
View user's profile Send private message
Arfrever
Bodhisattva
Bodhisattva


Joined: 29 Apr 2006
Posts: 2463
Location: 異世界

PostPosted: Tue Jun 05, 2007 3:47 pm    Post subject: Reply with quote

mntnoe wrote:
What is the recommended way of setting application specific CFLAGS (like using /etc/portage/package.use for USE-flags)?

Read:
Code:
man portage


Perduodu linkėjimus
Arfrever
Back to top
View user's profile Send private message
Ishiki
Tux's lil' helper
Tux's lil' helper


Joined: 31 Aug 2005
Posts: 86

PostPosted: Tue Jun 05, 2007 6:04 pm    Post subject: Reply with quote

mntnoe, Can you write down your start times for Firefox and OOo before and after changing -O2 to -Os ?
Back to top
View user's profile Send private message
mntnoe
n00b
n00b


Joined: 21 Jan 2007
Posts: 61
Location: Denmark

PostPosted: Wed Jun 06, 2007 12:36 pm    Post subject: Reply with quote

I didn't notice any difference with firefox, I'm afraid. The test, however, is not that accurate:

-O2: I copied a mozilla-firefox-2.0.0.3 with pango and gnome support from my desktop top my laptop, which resulted in about 8.6 sec for a cold cache, and 2.4 sec for a warm cache.

-Os: mozilla-firefox-2.0.0.4 without pango and gnome support, compiled from scratch on my laptop. 8.3 sec/cold cache, and 2.3 sec/warm cache.

The other CFLAGS on the machines are identical. Also I used GNU time to measure the load time, and hurried to close firefox as soon as possible. So don't take the results too seriously.

From another thread I started:
eccerr0r wrote:
On my machines that I care about disk space a lot I do use -Os (specifically, CF disks). However I've found in practice it doesn't really help too much loading, burst speed reads are only a fraction of total time to satisfy requests (hint: seek times)

So I'm afraid -Os was not what I needed here.

Arfrever, I can't find it in the portage man-file. Could you please specify it?

BTW Prelinking wouldn't be a good idea when using a slow harddisk, would it?
Back to top
View user's profile Send private message
Arfrever
Bodhisattva
Bodhisattva


Joined: 29 Apr 2006
Posts: 2463
Location: 異世界

PostPosted: Thu Jun 07, 2007 6:01 pm    Post subject: Reply with quote

mntnoe wrote:
Arfrever, I can't find it in the portage man-file. Could you please specify it?

"/etc/portage/bashrc" or "profile.bashrc" from some profile.

You can use "profile.bashrc" from "${PORTDIR}/profiles/base".
${PORTDIR}/profiles/base/profile.bashrc:
for conf in ${PN} ${PN}-${PV} ${PN}-${PV}-${PR}; do
   [[ -r ${PORTAGE_CONFIGROOT}/etc/portage/env/${CATEGORY}/${conf} ]] \
      && . ${PORTAGE_CONFIGROOT}/etc/portage/env/${CATEGORY}/${conf}
done

Example of use:
Code:
mkdir -p /etc/portage/env/sys-libs
echo -e 'CFLAGS="${CFLAGS// -ftree-vectorize/}"\nCXXFLAGS="${CXXFLAGS// -ftree-vectorize/}"' > /etc/portage/env/sys-libs/zlib



Perduodu linkėjimus
Arfrever
Back to top
View user's profile Send private message
mntnoe
n00b
n00b


Joined: 21 Jan 2007
Posts: 61
Location: Denmark

PostPosted: Fri Jun 08, 2007 7:43 am    Post subject: Reply with quote

Thank you very much, that was exactly what I needed...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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