October 05, 2002
Walter wrote:
> "Burton Radons" <loth@users.sourceforge.net> wrote in message
> news:an827i$2hc4$1@digitaldaemon.com...
> 
>>No - it goes through a normal vtable, so it's as fast as a completely
>>virtual object, although it's twice as large on stack (if I understand
>>the object model properly - interfaces aren't in my port yet).  Which I
>>appear to not, looking at DMD.  Walter, is there a search involved in
>>calling a method on any interface reference?  If there is, it'll be
>>significantly slower.  If there isn't, it'll be slightly faster
>>depending on how the cache is feeling.
> 
> No, no search. It uses vtbl[]s and adjustor thunks, and so is as efficient
> as MI dispatch in C++.

Know of a link describing memory behaviour here?  Glancing over C++'s spec, I don't see them describing it.  Although to be honest, I can't look too hard at it for fear of becoming blind or insane.

October 06, 2002
"Burton Radons" <loth@users.sourceforge.net> wrote in message news:annomt$1ujr$2@digitaldaemon.com...
> Walter wrote:
> > No, no search. It uses vtbl[]s and adjustor thunks, and so is as
efficient
> > as MI dispatch in C++.
> Know of a link describing memory behaviour here?  Glancing over C++'s spec, I don't see them describing it.  Although to be honest, I can't look too hard at it for fear of becoming blind or insane.

It wouldn't be described in the C++ spec, as it's an implementation detail. I think Bjarne Stroustrup wrote an article on a scheme to do this long ago, but I can't recall for sure. Check his web site.


October 12, 2002
"Walter" <walter@digitalmars.com> writes:

> "Burton Radons" <loth@users.sourceforge.net> wrote in message news:annomt$1ujr$2@digitaldaemon.com...
>> Walter wrote:
>> > No, no search. It uses vtbl[]s and adjustor thunks, and so is as
> efficient
>> > as MI dispatch in C++.
>> Know of a link describing memory behaviour here?  Glancing over C++'s spec, I don't see them describing it.  Although to be honest, I can't look too hard at it for fear of becoming blind or insane.
>
> It wouldn't be described in the C++ spec, as it's an implementation detail. I think Bjarne Stroustrup wrote an article on a scheme to do this long ago, but I can't recall for sure. Check his web site.

Stroustrup's paper "Multiple Inheritance in C++" is available at:

http://citeseer.nj.nec.com/stroustrup99multiple.html


Antti.
October 12, 2002
By the way,

here's another paper I bumped into. It claims to do faster MI virtual function call dispatch than the traditional C++ compilers, also enabling separate compilation of base classes:

http://citeseer.nj.nec.com/myers95bidirectional.html

The abstract:

  Bidirectional Object Layout for Separate Compilation

  Existing schemes for object layout and dispatch in the presence of
  multiple inheritance and separate compilation waste space and are
  slower than systems with single inheritance. This paper describes
  the bidirectional object layout, a new scheme for object layout that
  produces smaller objects and faster method invocations than existing
  schemes by automatically optimizing particular uses of multiple
  inheritance. The bidirectional object layout is used for the
  programming language Theta, and is applicable to languages like C++.
  This paper also demonstrates how to efficiently implement method
  dispatch when method signatures are allowed to change in subclasses.
  Most current statically compiled languages require identical
  signatures for efficiency.

A.
October 12, 2002
Thanks!


1 2
Next ›   Last »