That translation is the problem that is true.

In general I'm not avoiding the lookup at all. Just trying to speed it up.
When looking at method I also found that there is a "root" method for all 
clones. So perhaps an IdentityMap would be 
possible on that (unfortunately it is private like slot).

Michael

Am 06.03.2009 2:25 Uhr, schrieb Rickard Öberg:
> Michael Hunger wrote:
>> I looked into another direction. (Or rather two).
>>
>> First I replaced the HashMap by an GrowingMap that uses an Array(List) 
>> backed Map implementation up until 10 elements
>> and a HashMap later. As I assume that a single mixin will seldom have more 
>> than 10 methods this should speed up things
>> considerably. On my machine it went up from 2 mio to 3.3 mio invocations / s.
>>
>> Secondly. I looked at the implementation of method.equals and it seems to be 
>> quite expensive (imho).
>>
>> I started replacing method with a MethodInfo object in CompositeModel but it 
>> didn't work out as creating the MethodInfo
>> again and again costs to much. If the method info was the object that would 
>> be handled inside of qi4j then the benefit
>> would appear as it wouldn't have to be created all the time. (Additional 
>> benefit would be that it can handle
>> serialization of methods and so no separate method-map implementation would 
>> be needed anymore.
>>
>> If you think this is useful I'll submit it into the repo (the first one)
>
> Definitely sounds interesting. The main problem I can see is that when
> we get a proxy call from Dynamic Proxies we get a Method, which then has
> to be translated into the internal MethodInfo. Doesn't that lead to the
> same lookup as we are talking about? Or how would you avoid that lookup?
> With CGLIB it is trivial, of course, but with plain proxies?


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to