[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inheritance - why so slow?
From: |
John Max Skaller |
Subject: |
Re: Inheritance - why so slow? |
Date: |
Tue, 12 Oct 2004 13:05:28 +1000 |
User-agent: |
Pan/0.13.3 (That cat's something I can't explain) |
On Thu, 07 Oct 2004 18:34:44 -0700, Paul Pluzhnikov wrote:
> "Krzysztof Duleba" <krzysan@skrzynka.pl> writes:
>
>> Nobody else finds this interesting?
>
> No, not really.
>
> Draw inheritance tree for the code you are generating (just do it
> for N=3), and count how many classes A3 inherits from (directly
> and indirectly). The compiler has to search them all.
>
> Since that number grows exponentially (2**N - 1), why are you
> surprized that you see an exponential slow-down?
That may not be the problem. Some version of g++
are *extremely* slow. I have 3.2.2, I'm not sure where
the slowdown actually is, but a simple
but very long function is totally uncompilable on
my system.