From: Godmar Back (gback@cs.utah.edu)
Date: Sun Dec 20 1998 - 00:46:28 EST
>
> > What I did is to precompute and store the indices in the method dispatch
> > table where a given interface method sits (if it's there).
> > This is stored in the itable2dtable array.
>
> > The complexity of the new implementation is
> > O(number of interfaces implemented by that class) plus a constant.
>
> This could be made still faster by making itable2dtable a hashtable,
> instead of an array. Since the hash table will be computed at class
> load time, we can ensure that it is a perfect hash table (on the
> interface address). Then, instead of O(nI), it would become O(1), and
> I don't expect the memory overhead to be large.
That's a great idea. Give it a try.
On the other hand, in the presumably frequent case where I hit the
first interface in if2itable, you would not save anything.
I was surprised myself to find such a small overall performance
improvement. Of course, I could have constructed a test case where
the optimization would really kick in, but still.
>
> > This is why Alexandre's "performance.java" is somewhat bogus, since
> > it perform invokeinterface on a class with only one or two methods.
>
> In fact, it was designed to measure the impact of introducing
> reflection abilities (Guaranį) in Kaffe, so the tests were created so
> that Kaffe would do the minimal amount of computation, so that the
> impact would be maximum.
>
Now is that cheating or not ;-)
- Godmar
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:25 EDT