Mailing List Archive

Advice for CFLAGS
Hi guys!

I know, it must be boring to hear that question again and again and again but
I would really appreciate it if you could share some of your experience and
insight with me.

I'm planning to set up a gentoo laptop. It's got only 512MB RAM DDR2-667 and
the slowest of all Core Solo CPUs (T1200).

However, it has got quiet a bit L2 cache (2048kb) compared to 2x512kb on my
desktop PC (AMD64 X2).

Now I'm wondering if a more frequent use of O3 might be a good idea because of
that much cache or if it would just fill up my RAM.


Thanks in advance!

Florian Philipp
Re: Advice for CFLAGS [ In reply to ]
> Now I'm wondering if a more frequent use of O3 might be a good idea
> because of that much cache or if it would just fill up my RAM.

Which application is it you will run that you feel will need those
extra few percent in performance that the optimizations can give you?

--DA
Re: Advice for CFLAGS [ In reply to ]
Am Donnerstag 07 Juni 2007 21:47 schrieb Daniel Armyr:
> > Now I'm wondering if a more frequent use of O3 might be a good idea
> > because of that much cache or if it would just fill up my RAM.
>
> Which application is it you will run that you feel will need those
> extra few percent in performance that the optimizations can give you?
>
> --DA

Well, I suppose that's part of the problem. What does O3 improve?

Does it decrease the CPU-load of stuff like mplayer? Does it improve the
response speed of window managers and typical office and internet
applications? Or does ist just help when it comes to pure ALU and FPU power,
for example bzip2, gcc or spamassassin?
Re: Advice for CFLAGS [ In reply to ]
> Well, I suppose that's part of the problem. What does O3 improve?

I cannot speak for the -03 from gcc specifically, but most
optimizations tend to increase the processes within the CPU. Further,
for them to help, the compiler tends to need to, at compile time, know
how the code will run. As such, it does almost nothing for event-driven
code like the entire X-windows system. Further, I would like to see the
linux computer today which has a processing problem when it comes to X.
The disk-access times to load binaries far overshadow anything
processor related in all computers I have seen.

My suggestion to the general user: Get raided, super-fast scsi disks and
a mobo with low-latency memory if you want a truly fast computer.
Re: Advice for CFLAGS [ In reply to ]
From the documentation:

Optimize yet more. -O3 turns on all optimizations specified by -O2
and also turns on the -finline-functions, -funswitch-loops and
-fgcse-after-reload options.

--DA
Re: Advice for CFLAGS [ In reply to ]
Am Freitag 08 Juni 2007 07:35 schrieb Daniel Armyr:
> > Well, I suppose that's part of the problem. What does O3 improve?
>
> I cannot speak for the -03 from gcc specifically, but most
> optimizations tend to increase the processes within the CPU. Further,
> for them to help, the compiler tends to need to, at compile time, know
> how the code will run. As such, it does almost nothing for event-driven
> code like the entire X-windows system. Further, I would like to see the
> linux computer today which has a processing problem when it comes to X.
> The disk-access times to load binaries far overshadow anything
> processor related in all computers I have seen.
>
> My suggestion to the general user: Get raided, super-fast scsi disks and
> a mobo with low-latency memory if you want a truly fast computer.

In other words, there is no clear answer but my chances are quiet bad.

I think I'll try around a bit. I'll prepare three images on my desktop, one
Os, one O2 and one O3.

Then I'll post my experience...
Re: Advice for CFLAGS [ In reply to ]
On Fri, Jun 08, 2007 at 11:26:54AM +0200, Florian Philipp wrote:
> In other words, there is no clear answer but my chances are quiet bad.
>
> I think I'll try around a bit. I'll prepare three images on my desktop, one
> Os, one O2 and one O3.
>
> Then I'll post my experience...

Just from personal experience: I once compiled everything using O3 and
couldn't tell any appreciable difference in speed on most applications.
It also seemed to cause some applications to behave oddly or crash at
weird times. Booting off of a boot cd and recompiling the whole system
with O2 fixed all of the problems.

That was with a PIII, though. I understand many apps now that have
trouble with O3 are force to O2 with their ebuild, so your experience
may end up being a lot different. It hasn't been worth it for me to try
it again.
--

Mike Spitzer
mwspitzer@gmail.com
Re: Advice for CFLAGS [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mike Spitzer wrote:
> On Fri, Jun 08, 2007 at 11:26:54AM +0200, Florian Philipp wrote:
>> In other words, there is no clear answer but my chances are quiet bad.
>>
>> I think I'll try around a bit. I'll prepare three images on my desktop, one
>> Os, one O2 and one O3.
>>
>> Then I'll post my experience...
>
> Just from personal experience: I once compiled everything using O3 and
> couldn't tell any appreciable difference in speed on most applications.
> It also seemed to cause some applications to behave oddly or crash at
> weird times. Booting off of a boot cd and recompiling the whole system
> with O2 fixed all of the problems.
>
> That was with a PIII, though. I understand many apps now that have
> trouble with O3 are force to O2 with their ebuild, so your experience
> may end up being a lot different. It hasn't been worth it for me to try
> it again.

I don't think it's just P3; I've heard of -O3 causing instability,
crashes, or whatnot on other archs too. The best thing is probably to
use -O2 in general, and use higher optimizations for specific
applications that you want to tune.

- --Ravi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGaYAgsDgfoknqAqMRAi6cAJ9GeQB9b/teXJfLryaphs7oMcD86gCg2CPF
DDuJ8i09alnSxao84lLwcik=
=vYOn
-----END PGP SIGNATURE-----
--
gentoo-performance@gentoo.org mailing list