31 messages in org.codehaus.groovy.devRe: [groovy-dev] as usual on performa...| From | Sent On | Attachments |
|---|---|---|
| Alex Tkachman | 27 Feb 2008 05:38 | |
| Guillaume Laforge | 27 Feb 2008 05:47 | |
| Alex Tkachman | 27 Feb 2008 06:01 | |
| Chanwit Kaewkasi | 27 Feb 2008 06:21 | |
| Martin C. Martin | 27 Feb 2008 06:27 | |
| Jochen Theodorou | 27 Feb 2008 06:32 | |
| Jochen Theodorou | 27 Feb 2008 06:33 | |
| tugwilson | 27 Feb 2008 06:55 | |
| Chanwit Kaewkasi | 27 Feb 2008 07:15 | |
| Chanwit Kaewkasi | 27 Feb 2008 08:01 | |
| Jochen Theodorou | 27 Feb 2008 08:28 | |
| tugwilson | 27 Feb 2008 09:00 | |
| tugwilson | 27 Feb 2008 09:55 | |
| Chanwit Kaewkasi | 27 Feb 2008 11:27 | |
| Chanwit Kaewkasi | 27 Feb 2008 11:31 | |
| Jochen Theodorou | 27 Feb 2008 11:36 | |
| Alex Tkachman | 27 Feb 2008 11:58 | |
| Martin C. Martin | 27 Feb 2008 12:18 | |
| Jochen Theodorou | 27 Feb 2008 12:37 | |
| Jochen Theodorou | 27 Feb 2008 12:45 | |
| tugwilson | 27 Feb 2008 12:48 | |
| tugwilson | 27 Feb 2008 12:51 | |
| Martin C. Martin | 27 Feb 2008 13:27 | |
| Alex Tkachman | 27 Feb 2008 13:48 | |
| tugwilson | 27 Feb 2008 14:14 | |
| Jochen Theodorou | 27 Feb 2008 17:09 | |
| Alexandru Popescu ☀ | 27 Feb 2008 17:38 | |
| Charles Oliver Nutter | 28 Feb 2008 00:20 | |
| Jochen Theodorou | 28 Feb 2008 01:33 | |
| Alexandru Popescu ☀ | 28 Feb 2008 02:56 | |
| tugwilson | 28 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:




