kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #04401
Re: Graphics Abstraction Layer (was Re: wxDC & wxGraphicsContext Test)
-
To:
kicad-devel@xxxxxxxxxxxxxxx
-
From:
al davis <ad10@...>
-
Date:
Wed, 24 Feb 2010 14:34:10 -0500
-
In-reply-to:
<4B854D94.2020007@...>
-
User-agent:
KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; )
On Wednesday 24 February 2010, Wayne Stambaugh wrote:
> Each level of derivation adds an additional index dereference
> to the vtable of the class it is derived from. If you don't
> derive from a base class then no dereferencing overhead is
> incurred. With modern processors it probably makes little
> difference in speed and certainly nothing compared to the
> speed increase (hopefully) of using a hardware accelerated
> drawing API.
>
That is not what I recall ...
As I remember, each vtable is complete, so any call is:
(*(this->_vtable->function))(args);
regardless of the depth.
There is a link back for other reasons, but calling a virtual
function does not trace back.
I admit I have not looked at it in many years, but when I did
this is what it did. In the early days of C++ and STL I
questioned the efficiency cost, so I investigated some of what I
thought were potential issues. Every time, I found that the
actual implementation was sensible and efficient. Stroustrup
has stated in public that run time efficiency was considered
important, and that no sacrifice compared to C was acceptable.
Follow ups
References