31 messages in org.codehaus.groovy.devRe: [groovy-dev] as usual on performa...
FromSent OnAttachments
Alex TkachmanFeb 27, 2008 5:38 am 
Guillaume LaforgeFeb 27, 2008 5:47 am 
Alex TkachmanFeb 27, 2008 6:01 am 
Chanwit KaewkasiFeb 27, 2008 6:21 am 
Martin C. MartinFeb 27, 2008 6:27 am 
Jochen TheodorouFeb 27, 2008 6:32 am 
Jochen TheodorouFeb 27, 2008 6:33 am 
tugwilsonFeb 27, 2008 6:55 am 
Chanwit KaewkasiFeb 27, 2008 7:15 am 
Chanwit KaewkasiFeb 27, 2008 8:01 am 
Jochen TheodorouFeb 27, 2008 8:28 am 
tugwilsonFeb 27, 2008 9:00 am 
tugwilsonFeb 27, 2008 9:55 am 
Chanwit KaewkasiFeb 27, 2008 11:27 am 
Chanwit KaewkasiFeb 27, 2008 11:31 am 
Jochen TheodorouFeb 27, 2008 11:36 am 
Alex TkachmanFeb 27, 2008 11:58 am 
Martin C. MartinFeb 27, 2008 12:18 pm 
Jochen TheodorouFeb 27, 2008 12:37 pm 
Jochen TheodorouFeb 27, 2008 12:45 pm 
tugwilsonFeb 27, 2008 12:48 pm 
tugwilsonFeb 27, 2008 12:51 pm 
Martin C. MartinFeb 27, 2008 1:27 pm 
Alex TkachmanFeb 27, 2008 1:48 pm 
tugwilsonFeb 27, 2008 2:14 pm 
Jochen TheodorouFeb 27, 2008 5:09 pm 
Alexandru Popescu ☀Feb 27, 2008 5:38 pm 
Charles Oliver NutterFeb 28, 2008 12:20 am 
Jochen TheodorouFeb 28, 2008 1:33 am 
Alexandru Popescu ☀Feb 28, 2008 2:56 am 
tugwilsonFeb 28, 2008 3:29 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [groovy-dev] as usual on performance - operations on primitivesActions...
From:Chanwit Kaewkasi (chan@gmail.com)
Date:Feb 27, 2008 7:15:50 am
List:org.codehaus.groovy.dev

Hi Jochen,

On 27/02/2008, Jochen Theodorou <blac@gmx.org> wrote:

how much more than using a normal Java class can there be to provide more type information? What kind of type information does the JIT need?

I probably used wrong words. The type information is there. But Groovy has no mechanism to *feed them back* because there is no something like interpreter in Groovy. I think this is by-design. MOP layer does its job only for dispatching methods. To boost the performance to be as fast as using primitives, I think it's needed to add some profiling technique to collect and utilize type information at runtime.

For example,

def myMethod() { def b = 10 def a = b + 2 }

compiles to

Class class1 = org.codehaus.groovy.trace.Demo.class; Class class2 = groovy.lang.MetaClass.class; Object b = new Integer(10); Object a = ScriptBytecodeAdapter.invokeMethodN(class1, b, "plus", new Object[] { new Integer(2) });

By using my human eyes, I can see that 'b' is an integer. But during the execution, no one knows its type because. Then, when invoking "plus", we can know that it is called for an integer by trapping invokeMethodN, but we never know that it's 'b'.

I think if we can trace along these 2 expressions, we then can create equivalent set of bytecodes for them using primitives, and execute the new generated codes next time this method is executed.

Is it feasible ?

Cheers,

Chanwit

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

http://xircles.codehaus.org/manage_email