View previous topic :: View next topic |
Author |
Message |
mntnoe n00b
Joined: 21 Jan 2007 Posts: 61 Location: Denmark
|
Posted: Tue Jun 05, 2007 3:27 pm Post subject: CFLAGS and large applications |
|
|
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 |
|
|
neysx Retired Dev
Joined: 27 Jan 2003 Posts: 795
|
Posted: Tue Jun 05, 2007 3:38 pm Post subject: |
|
|
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 |
|
|
Arfrever Bodhisattva
Joined: 29 Apr 2006 Posts: 2463 Location: 異世界
|
Posted: Tue Jun 05, 2007 3:47 pm Post subject: |
|
|
mntnoe wrote: | What is the recommended way of setting application specific CFLAGS (like using /etc/portage/package.use for USE-flags)? |
Read:
Perduodu linkėjimus
Arfrever |
|
Back to top |
|
|
Ishiki Tux's lil' helper
Joined: 31 Aug 2005 Posts: 86
|
Posted: Tue Jun 05, 2007 6:04 pm Post subject: |
|
|
mntnoe, Can you write down your start times for Firefox and OOo before and after changing -O2 to -Os ? |
|
Back to top |
|
|
mntnoe n00b
Joined: 21 Jan 2007 Posts: 61 Location: Denmark
|
Posted: Wed Jun 06, 2007 12:36 pm Post subject: |
|
|
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 |
|
|
Arfrever Bodhisattva
Joined: 29 Apr 2006 Posts: 2463 Location: 異世界
|
Posted: Thu Jun 07, 2007 6:01 pm Post subject: |
|
|
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 |
|
|
mntnoe n00b
Joined: 21 Jan 2007 Posts: 61 Location: Denmark
|
Posted: Fri Jun 08, 2007 7:43 am Post subject: |
|
|
Thank you very much, that was exactly what I needed... |
|
Back to top |
|
|
|