public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC speed
@ 1999-12-22 17:15 Andy Rysin
  1999-12-23  2:21 ` Martin v. Loewis
  1999-12-31 23:54 ` Andy Rysin
  0 siblings, 2 replies; 10+ messages in thread
From: Andy Rysin @ 1999-12-22 17:15 UTC (permalink / raw)
  To: gcc

Hello All!

I am compiling large C++ project  (about 40K lines)
using Qt under Linux with GCC (egcs-1.1.2) and under
Win95 with Borland C++ Builder 4.
The point is compile time with GCC is about 2.5 time
of BCC one. (MSVC is about as slow as G++ also on this
hardware)
I tried gcc-2.95.x but compile time is mostly the
same.
Would you please tell me what is the bottleneck of G++
for today?

Besides QT I am using templates but is restricted to
one *.h and one *.cpp files and stl::string class.

Config is RH6.1/2.3.29 and Win95 on Compaq Armada with
P200MMX/96M

TIA,
Andy.
__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GCC speed
  1999-12-22 17:15 GCC speed Andy Rysin
@ 1999-12-23  2:21 ` Martin v. Loewis
  1999-12-23  2:33   ` Gerald Pfeifer
  1999-12-31 23:54   ` Martin v. Loewis
  1999-12-31 23:54 ` Andy Rysin
  1 sibling, 2 replies; 10+ messages in thread
From: Martin v. Loewis @ 1999-12-23  2:21 UTC (permalink / raw)
  To: arysin; +Cc: gcc

> Would you please tell me what is the bottleneck of G++
> for today?

AFAIK, there are two major consumers of compile time in g++ today:
overload resolution, and template instantiation.

When you have lots of functions with the same name, g++ will need some
time for each call, in overload resolution. This is what makes a C
compiler faster: You don't have overload resolution in C. Things get
more tricky due to conversion sequences, which all have to be
computed.

For templates, every instantiation is time-consuming, as it involves
creating a deep copy of the template. This nicely combines with
overload resolution: If lookup finds a template function, the
following things must happen:
- deduction of template arguments from the function call arguments
- instantiation of the selected template
- computation of conversion sequences for the instantiated parameters
- participation of the instance in overload resolution.

Please note that the standard library defines a number of template
functions on its own, so you might see more templates than you are
aware of. Template operators are particularly bad, since you need to
look at them every time an operator is used. For example, for strings,
there is an operator

template <class charT, class traits, class Allocator>
inline bool
operator>= (const basic_string <charT, traits, Allocator>& lhs,
	    const basic_string <charT, traits, Allocator>& rhs)
{
  return (lhs.compare (rhs) >= 0);
}

This is considered every time you have >= in your program, and so on.

You may want to check out the development snapshot of gcc and see how
it works, it should have a number of improvements in the area of
compilation speed; although nobody has analysed this in detail, so far.

Hope this helps,
Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GCC speed
  1999-12-23  2:21 ` Martin v. Loewis
@ 1999-12-23  2:33   ` Gerald Pfeifer
  1999-12-31 23:54     ` Gerald Pfeifer
  1999-12-31 23:54   ` Martin v. Loewis
  1 sibling, 1 reply; 10+ messages in thread
From: Gerald Pfeifer @ 1999-12-23  2:33 UTC (permalink / raw)
  To: arysin; +Cc: Martin v. Loewis, gcc

On Thu, 23 Dec 1999, Martin v. Loewis wrote:
> You may want to check out the development snapshot of gcc and see how
> it works, it should have a number of improvements in the area of
> compilation speed; although nobody has analysed this in detail, so far.

For my (template heavy) code development snapshots are quite a bit slower
and need twice as much memory as GCC 2.95.x, and there have been similiar
reports by others, so I'd recommended carefully checking which version if
better for your need.

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* GCC speed
  1999-12-22 17:15 GCC speed Andy Rysin
  1999-12-23  2:21 ` Martin v. Loewis
@ 1999-12-31 23:54 ` Andy Rysin
  1 sibling, 0 replies; 10+ messages in thread
From: Andy Rysin @ 1999-12-31 23:54 UTC (permalink / raw)
  To: gcc

Hello All!

I am compiling large C++ project  (about 40K lines)
using Qt under Linux with GCC (egcs-1.1.2) and under
Win95 with Borland C++ Builder 4.
The point is compile time with GCC is about 2.5 time
of BCC one. (MSVC is about as slow as G++ also on this
hardware)
I tried gcc-2.95.x but compile time is mostly the
same.
Would you please tell me what is the bottleneck of G++
for today?

Besides QT I am using templates but is restricted to
one *.h and one *.cpp files and stl::string class.

Config is RH6.1/2.3.29 and Win95 on Compaq Armada with
P200MMX/96M

TIA,
Andy.
__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GCC speed
  1999-12-23  2:33   ` Gerald Pfeifer
@ 1999-12-31 23:54     ` Gerald Pfeifer
  0 siblings, 0 replies; 10+ messages in thread
From: Gerald Pfeifer @ 1999-12-31 23:54 UTC (permalink / raw)
  To: arysin; +Cc: Martin v. Loewis, gcc

On Thu, 23 Dec 1999, Martin v. Loewis wrote:
> You may want to check out the development snapshot of gcc and see how
> it works, it should have a number of improvements in the area of
> compilation speed; although nobody has analysed this in detail, so far.

For my (template heavy) code development snapshots are quite a bit slower
and need twice as much memory as GCC 2.95.x, and there have been similiar
reports by others, so I'd recommended carefully checking which version if
better for your need.

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GCC speed
  1999-12-23  2:21 ` Martin v. Loewis
  1999-12-23  2:33   ` Gerald Pfeifer
@ 1999-12-31 23:54   ` Martin v. Loewis
  1 sibling, 0 replies; 10+ messages in thread
From: Martin v. Loewis @ 1999-12-31 23:54 UTC (permalink / raw)
  To: arysin; +Cc: gcc

> Would you please tell me what is the bottleneck of G++
> for today?

AFAIK, there are two major consumers of compile time in g++ today:
overload resolution, and template instantiation.

When you have lots of functions with the same name, g++ will need some
time for each call, in overload resolution. This is what makes a C
compiler faster: You don't have overload resolution in C. Things get
more tricky due to conversion sequences, which all have to be
computed.

For templates, every instantiation is time-consuming, as it involves
creating a deep copy of the template. This nicely combines with
overload resolution: If lookup finds a template function, the
following things must happen:
- deduction of template arguments from the function call arguments
- instantiation of the selected template
- computation of conversion sequences for the instantiated parameters
- participation of the instance in overload resolution.

Please note that the standard library defines a number of template
functions on its own, so you might see more templates than you are
aware of. Template operators are particularly bad, since you need to
look at them every time an operator is used. For example, for strings,
there is an operator

template <class charT, class traits, class Allocator>
inline bool
operator>= (const basic_string <charT, traits, Allocator>& lhs,
	    const basic_string <charT, traits, Allocator>& rhs)
{
  return (lhs.compare (rhs) >= 0);
}

This is considered every time you have >= in your program, and so on.

You may want to check out the development snapshot of gcc and see how
it works, it should have a number of improvements in the area of
compilation speed; although nobody has analysed this in detail, so far.

Hope this helps,
Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GCC speed
  1999-12-28 15:33 Mike Stump
@ 1999-12-31 23:54 ` Mike Stump
  0 siblings, 0 replies; 10+ messages in thread
From: Mike Stump @ 1999-12-31 23:54 UTC (permalink / raw)
  To: arysin, gcc

> Date: Wed, 22 Dec 1999 17:14:56 -0800 (PST)
> From: Andy Rysin <arysin@yahoo.com>

> The point is compile time with GCC is about 2.5 time of BCC one.

Sure, compile with -O0 and see if that makes a difference.  Next, you
can try -fno-inlines -fno-inline-functions and see if that help.
After that, you might try -frepo.  In this last case, compare times
with the second compile, not the first compile.

Some or all of these might make your compile go faster.  The expense
will be in generated code quality.  Feel free to compare code quality
between the two compilers as well.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GCC speed
@ 1999-12-28 15:33 Mike Stump
  1999-12-31 23:54 ` Mike Stump
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Stump @ 1999-12-28 15:33 UTC (permalink / raw)
  To: arysin, gcc

> Date: Wed, 22 Dec 1999 17:14:56 -0800 (PST)
> From: Andy Rysin <arysin@yahoo.com>

> The point is compile time with GCC is about 2.5 time of BCC one.

Sure, compile with -O0 and see if that makes a difference.  Next, you
can try -fno-inlines -fno-inline-functions and see if that help.
After that, you might try -frepo.  In this last case, compare times
with the second compile, not the first compile.

Some or all of these might make your compile go faster.  The expense
will be in generated code quality.  Feel free to compare code quality
between the two compilers as well.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* gcc speed
  1999-03-05  5:02 gcc speed Jochen Kuepper
@ 1999-03-31 23:46 ` Jochen Kuepper
  0 siblings, 0 replies; 10+ messages in thread
From: Jochen Kuepper @ 1999-03-31 23:46 UTC (permalink / raw)
  To: Linux/AXP, egcs mailing list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

Citing from http://www.cs.utk.edu/~rwhaley/ATLAS/errata.html:

  Dec ALPHA compilers

  If you are using a DEC Alpha, it is extremely important to use gnu gcc,
  rather than egcs gcc. On my 533Mhz Dec ALPHA, using egcs 1.1.1 and gnu gcc
  2.8.1, gcc provides roughly 590 Mflop DGEMM, whereas egcs results in 520 or
  so. User's of DEC unix should be aware that cc should not be used to compile
  the generated code. The compiler does not allow the turning off of
  optimizations that cause optimal code to run slower, so you should compile
  these routines with gcc. 
  [snip]

What do you think about that. Has anybody else some numbers to compare ?

Greetings,
Jochen
-----------------------------------------------------------------------
  Jochen Küpper

  Heinrich-Heine-Universität Düsseldorf     jochen@uni-duesseldorf.de
  Institut für Physikalische Chemie I
  Universitätsstr. 1, Geb 26.43 Raum 02.29     phone ++49-211-8113681
  40225 Düsseldorf                             fax   ++49-211-8115195
  Germany             http://www-public.rz.uni-duesseldorf.de/~jochen
-----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 10+ messages in thread

* gcc speed
@ 1999-03-05  5:02 Jochen Kuepper
  1999-03-31 23:46 ` Jochen Kuepper
  0 siblings, 1 reply; 10+ messages in thread
From: Jochen Kuepper @ 1999-03-05  5:02 UTC (permalink / raw)
  To: Linux/AXP, egcs mailing list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

Citing from http://www.cs.utk.edu/~rwhaley/ATLAS/errata.html:

  Dec ALPHA compilers

  If you are using a DEC Alpha, it is extremely important to use gnu gcc,
  rather than egcs gcc. On my 533Mhz Dec ALPHA, using egcs 1.1.1 and gnu gcc
  2.8.1, gcc provides roughly 590 Mflop DGEMM, whereas egcs results in 520 or
  so. User's of DEC unix should be aware that cc should not be used to compile
  the generated code. The compiler does not allow the turning off of
  optimizations that cause optimal code to run slower, so you should compile
  these routines with gcc. 
  [snip]

What do you think about that. Has anybody else some numbers to compare ?

Greetings,
Jochen
-----------------------------------------------------------------------
  Jochen Küpper

  Heinrich-Heine-Universität Düsseldorf     jochen@uni-duesseldorf.de
  Institut für Physikalische Chemie I
  Universitätsstr. 1, Geb 26.43 Raum 02.29     phone ++49-211-8113681
  40225 Düsseldorf                             fax   ++49-211-8115195
  Germany             http://www-public.rz.uni-duesseldorf.de/~jochen
-----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1999-12-31 23:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-22 17:15 GCC speed Andy Rysin
1999-12-23  2:21 ` Martin v. Loewis
1999-12-23  2:33   ` Gerald Pfeifer
1999-12-31 23:54     ` Gerald Pfeifer
1999-12-31 23:54   ` Martin v. Loewis
1999-12-31 23:54 ` Andy Rysin
  -- strict thread matches above, loose matches on Subject: below --
1999-12-28 15:33 Mike Stump
1999-12-31 23:54 ` Mike Stump
1999-03-05  5:02 gcc speed Jochen Kuepper
1999-03-31 23:46 ` Jochen Kuepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).