Am 30.11.2011 14:02, schrieb Rémi Forax:
[...]
>>> What kind of initialization work is this? Could the result of that work
>>> be cached?
>> we have to setup the initial meta class system, which requires to use
>> reflection to inspect some classes and other work. Yes, this could be
>> cached, if we would know how.
>
> It worth to give a try to java.lang.ClassValue, here.
> You you be able to create your metaclass only when needed.
>
> Also note that you can also lazyly initialize the list of methods,
> fields etc. because even if two threads ask the same list at the
> same time, the result will be the same, so there is no need
> to use synchronized here.
> (this is exactly what java.lang.Class code does) :

it is all lazy, but what gives it if you need it for even the most 
simple script? For

println 1+1

you will need the a meta class for the current class, you will need the 
int meta class, you will need to load the default methods too... and one 
second is burnt.

bye Jochen

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to