help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inheritance - why so slow?


From: Paul Pluzhnikov
Subject: Re: Inheritance - why so slow?
Date: 07 Oct 2004 18:34:44 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

"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?

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]