[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] New interface dispatch mechanism
From: |
Rhys Weatherley |
Subject: |
[Pnet-developers] New interface dispatch mechanism |
Date: |
Mon, 14 Jul 2003 08:44:38 +1000 |
User-agent: |
KMail/1.4.3 |
Hi all,
I have committed a new implementation for "call_interface". It is based on
the Interface Method Table (IMT) mechanism used by IBM's RVM engine for Java.
The following paper describes the methodology:
http://www.research.ibm.com/people/d/dgrove/papers/oopsla01.pdf
Briefly, each class now has a short 32-entry table associated with it for
dispatching interface method calls. The methods that implement interfaces
are hashed into this table. Most of the time, the hash will result in the
right method on the first try.
If there is a conflict (i.e. two methods hashing to the same position), the
implementation will bail out to the original interface lookup algorithm.
So, in the common case, the overhead is similar to a regular virtual method
call, and in the worst case it is similar to the original lookup algorithm.
Testing here seems to indicate conflict rates of less than 5%. Increasing the
table size would decrease the conflict rate further, so we can tune the table
size a bit if necessary.
Please play with this and see how it performs in practice.
Cheers,
Rhys.
- [Pnet-developers] New interface dispatch mechanism,
Rhys Weatherley <=