[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-dev
Subject:    Re: [groovy-dev] Optimising Groovy classes with Soot
From:       Jochen Theodorou <blackdrag () gmx ! org>
Date:       2007-08-23 9:58:45
Message-ID: 46CD5A55.8080408 () gmx ! org
[Download RAW message or body]

Graeme Rocher schrieb:
[...]
>> if (there is a Category in force and the MetaClass for x has been changed) {
>>    call invokeMethodQuick(x, foo) on the changed MetaClass
>> } else {
>>    call invokeMethodQuick(x, foo) on the original MetaClass
>> }
>>
>> Hotspot is very good at inlining this code.
> 
> Yeh exactly something like that. In my view moving forward we need to
> focus people on working with one interface for doing dynamic stuff and
> currently the only interface that Groovy has that allows all the
> flexiblity to create rich meta-programmed apps is EMC
> 
> Categories are limited and syntatically unpleasant and represent
> "another way to achieve the same thing".
> 
> However, I will wait for Jochen's ideas regarding the MetaClass
> re-design to come to frution before we add support for using EMCs as
> categories.

The clue in Ng is that you use a thread local context object all the 
time. So categories are very easy as long as this object is involved. To 
do the same in Groovy we have to add much more methods, because we need 
to give in the context as parameter.  Accessing a thread local from 
ThreadLocal is too slow. Of course ThreadLocal is also fast, it is fast 
if it allows you to remove complicated synchronization logic. But doing 
ThreadLocal#get for each method call is too slow.

I have some ideas I can try, but I have not yet an ideas how fast that 
will be.

bye blackdrag

-- 
Jochen "blackdrag" Theodorou
Groovy Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic