Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

improving gcc performance- suggestions? [c.l.c.m removed, gnu.gcc.help, linux.dev.gcc added]

0 views
Skip to first unread message

Dann Corbit

unread,
Aug 13, 2001, 1:41:36 PM8/13/01
to
"H.W. Stockman" <stoc...@earthlink.net> wrote in message
news:clcm-2001...@plethora.net...
> I have tested a scientific benchmark with several compilers, under both
> windows 98 and two flavors of linux. So far, the performance of
> _executables_
> generated by gcc 2.95.2 (-O2|-O3|-O6 -malign-double -
> fomit-frame-pointer -funroll-loops
> -fstrict-aliasing -ffloat-store -fexpensive-optimizations ...etc.) seems
> pretty dismal:
>
> (higher is better:)
> gcc / linux 0.47
> MS6/win98 1.98
> Intel5/win98 2.33
> MS6/win98/SIMD 3.78
> Intel5.01/win98/SIMD 5.72
> Intel5.01/linux/SIMD 5.72
>
> All run on the same P4 system, 1 GB RDRAM. The benchmark is both
> memory-and float-intensive, uses large dynamic arrays of floats, and has
> heavy
> pointer traffic. The time-critical function was hand-optimized to
> eliminate most pointer traffic. Almost all the operations are basic math;
> the
> dependence on libm should be minimal. For similar codes on the
> alphas, we found gcc to be nearly as good as DEC C, and hand
> pointer optimizations were adequate.
>
> I haven't used gcc or egcs in several years. What should I consider
> (options, gcc/egcs version) to improve gcc performance?
> Of all the options I tried for gcc, only -fstrict-aliasing
> made any difference, upping performance from a pitiful 0.31 to 0.47.
> I've been searching dejanews and gcc development for hints,
> and haven't found much. So far, this looks like a good
> advertisement for the Intel linux compiler, given the factor
> 12 performance improvement.
>
> Thanks; please fork replies to my e-mail as well as this newsgroup,
> as I read news on 6 different systems, with different groups selected.


You have chosen the most unfavorable areas for GCC. It is horribly lame
with floating point (my own observations confirm your worst suspicisions).
It also is not as good as some others with pointer manipulations at times.
There are areas where GCC shines (e.g. string operations, bitwise
operations).

Suggestion #1:
Try the options one at a time. Keep the ones that improve performance, and
discard those that harm performance. (In the end, there is simply no way
you are going to beat the Intel compiler on floating point operations
anyway).

Suggestion #2:
Post GCC questions to the GCC help groups. The experts there will know far
better how to solve your queries.

--
C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
"The C-FAQ Book" ISBN 0-201-84519-9
C.A.P. FAQ: ftp://cap.connx.com/pub/Chess%20Analysis%20Project%20FAQ.htm


0 new messages