31 messages in org.codehaus.groovy.devRe: [groovy-dev] as usual on performa...
FromSent OnAttachments
Alex Tkachman27 Feb 2008 05:38 
Guillaume Laforge27 Feb 2008 05:47 
Alex Tkachman27 Feb 2008 06:01 
Chanwit Kaewkasi27 Feb 2008 06:21 
Martin C. Martin27 Feb 2008 06:27 
Jochen Theodorou27 Feb 2008 06:32 
Jochen Theodorou27 Feb 2008 06:33 
tugwilson27 Feb 2008 06:55 
Chanwit Kaewkasi27 Feb 2008 07:15 
Chanwit Kaewkasi27 Feb 2008 08:01 
Jochen Theodorou27 Feb 2008 08:28 
tugwilson27 Feb 2008 09:00 
tugwilson27 Feb 2008 09:55 
Chanwit Kaewkasi27 Feb 2008 11:27 
Chanwit Kaewkasi27 Feb 2008 11:31 
Jochen Theodorou27 Feb 2008 11:36 
Alex Tkachman27 Feb 2008 11:58 
Martin C. Martin27 Feb 2008 12:18 
Jochen Theodorou27 Feb 2008 12:37 
Jochen Theodorou27 Feb 2008 12:45 
tugwilson27 Feb 2008 12:48 
tugwilson27 Feb 2008 12:51 
Martin C. Martin27 Feb 2008 13:27 
Alex Tkachman27 Feb 2008 13:48 
tugwilson27 Feb 2008 14:14 
Jochen Theodorou27 Feb 2008 17:09 
Alexandru Popescu ☀27 Feb 2008 17:38 
Charles Oliver Nutter28 Feb 2008 00:20 
Jochen Theodorou28 Feb 2008 01:33 
Alexandru Popescu ☀28 Feb 2008 02:56 
tugwilson28 Feb 2008 03:29 
Subject:Re: [groovy-dev] as usual on performance - operations on primitives
From:tugwilson (tu@wilson.co.uk)
Date:02/27/2008 12:51:43 PM
List:org.codehaus.groovy.dev

Jochen Theodorou wrote:

tugwilson schrieb: [...]

The main execution cost is fetching the MetaClass for b (Ng wraps ints in NgInt which has a getMetaClass method rather than Integer which requires a registry lookup), a check to see if a Category has changed the plus operation on int and a check that the plus operation on int has not been monkey patched. These costs are exactly equivalent to your "Integer#plus(Integer) is default" check, except the cost of getting the MetaClass for Integer is higher in Groovy.

well... theoretically it is enough to reuse that check for a certain amount of actions... for example:

int j=0; for (int i=0; i<n i++) { j+=i }

In this case we could check the MetaClass for Integer and if it is not modified, we could execute the code in its static form. This means for all n nest() calls and all n plus class we have only a single MetaClass check.

Checking outside the loop?

If so you're just deliberately breaking the semantics of the language.

John Wilson -- View this message in context:
http://www.nabble.com/as-usual-on-performance---operations-on-primitives-tp15713441p15722780.html Sent from the groovy - dev mailing list archive at Nabble.com.

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

http://xircles.codehaus.org/manage_email