kicad-developers team mailing list archive
Mailing list archive
Re: Graphics Abstraction Layer (was Re: wxDC & wxGraphicsContext Test)
al davis <ad10@...>
Wed, 24 Feb 2010 14:34:10 -0500
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:
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.