

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
62 messages in org.codehaus.groovy.devRe: [groovy-dev] Groovy performance: ...| From | Sent On | Attachments |
|---|---|---|
| Alex Tkachman | Feb 19, 2008 2:09 am | |
| Steven Devijver | Feb 19, 2008 2:37 am | |
| Alexandru Popescu ☀ | Feb 19, 2008 2:57 am | |
| Alex Tkachman | Feb 19, 2008 3:03 am | |
| Patric Bechtel | Feb 19, 2008 3:12 am | |
| Guillaume Laforge | Feb 19, 2008 3:25 am | |
| Guillaume Laforge | Feb 19, 2008 3:26 am | |
| Patric Bechtel | Feb 19, 2008 5:05 am | |
| Gavin Grover | Feb 19, 2008 5:51 am | |
| Steven Devijver | Feb 19, 2008 5:52 am | |
| Guillaume Laforge | Feb 19, 2008 5:54 am | |
| Tom Nichols | Feb 19, 2008 6:26 am | |
| Alex Tkachman | Feb 19, 2008 6:28 am | |
| Guillaume Laforge | Feb 19, 2008 6:35 am | |
| Tom Nichols | Feb 19, 2008 7:03 am | |
| Guillaume Laforge | Feb 19, 2008 7:38 am | |
| Chanwit Kaewkasi | Feb 19, 2008 7:52 am | |
| Charles Oliver Nutter | Feb 19, 2008 8:49 am | |
| Steven Devijver | Feb 19, 2008 10:03 am | |
| Charles Oliver Nutter | Feb 19, 2008 11:38 am | |
| Steven Devijver | Feb 19, 2008 12:11 pm | |
| Alex Tkachman | Feb 19, 2008 12:39 pm | |
| Alex Tkachman | Feb 19, 2008 12:48 pm | |
| tugwilson | Feb 19, 2008 1:36 pm | |
| Alex Tkachman | Feb 19, 2008 8:51 pm | |
| Guillaume Laforge | Feb 20, 2008 2:10 am | |
| Jochen Theodorou | Feb 20, 2008 9:46 am | |
| Martin C. Martin | Feb 20, 2008 5:25 pm | |
| Guillaume Laforge | Feb 21, 2008 1:35 am | |
| Tom Nichols | Feb 21, 2008 4:15 am | |
| Martin C. Martin | Feb 21, 2008 5:44 am | |
| Tom Nichols | Feb 21, 2008 6:22 am | |
| Smith, Jason, CTR, OASD(HA)/TMA | Feb 21, 2008 6:34 am | |
| Martin C. Martin | Feb 21, 2008 6:43 am | |
| Guillaume Laforge | Feb 21, 2008 6:48 am | |
| Guillaume Laforge | Feb 21, 2008 7:04 am | |
| Smith, Jason, CTR, OASD(HA)/TMA | Feb 21, 2008 7:18 am | |
| Charles Oliver Nutter | Feb 21, 2008 7:38 am | |
| Guillaume Laforge | Feb 21, 2008 7:42 am | |
| Martin C. Martin | Feb 21, 2008 8:36 am | |
| Martin C. Martin | Feb 21, 2008 8:48 am | |
| Pascal DeMilly | Feb 21, 2008 5:35 pm | |
| Gavin Grover | Feb 21, 2008 6:21 pm | |
| Jochen Theodorou | Feb 22, 2008 4:31 am | |
| Tom Nichols | Feb 22, 2008 4:49 am | |
| Charles Oliver Nutter | Feb 22, 2008 11:43 pm | |
| Guillaume Laforge | Feb 23, 2008 12:28 am | |
| Martin C. Martin | Feb 23, 2008 3:51 am | |
| Jochen Theodorou | Feb 23, 2008 2:49 pm | |
| Jochen Theodorou | Feb 23, 2008 2:53 pm | |
| Charles Oliver Nutter | Feb 24, 2008 2:01 am | |
| Martin C. Martin | Feb 24, 2008 3:56 am | |
| Martin C. Martin | Feb 24, 2008 4:11 am | |
| Charles Oliver Nutter | Feb 24, 2008 5:12 am | |
| Jochen Theodorou | Feb 24, 2008 3:17 pm | |
| Jochen Theodorou | Feb 24, 2008 3:31 pm | |
| Alexandru Popescu ☀ | Feb 24, 2008 3:36 pm | |
| Martin C. Martin | Feb 26, 2008 2:20 pm | |
| Martin C. Martin | Feb 26, 2008 3:15 pm | |
| Jochen Theodorou | Feb 27, 2008 2:38 am | |
| Jochen Theodorou | Feb 27, 2008 3:03 am | |
| Martin C. Martin | Mar 2, 2008 5:21 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [groovy-dev] Groovy performance: what to do | Actions... |
|---|---|---|
| From: | Martin C. Martin (mar...@martincmartin.com) | |
| Date: | Feb 24, 2008 4:11:57 am | |
| List: | org.codehaus.groovy.dev | |
Jochen Theodorou wrote:
Martin C. Martin schrieb: [...]
What do you think of the proposal that is simply a hint? The one where you tell the compiler you expect given object classes and metaclasses? There are two ways it could go:
- At runtime, if we don't have the expected classes & metaclasses, ignore the hint and do what you would have done anyway. This way, the semantics aren't changed, but if the types are as expected the call is much faster. If not, it's a little slower.
that's the way I want to go. With this we can speed up numeric operations as well as many other method calls *without* changing the semantics.
- At runtime, if things don't match, signal an error. This turns it into an assertion mechanism. This might be helpful in tracking down bugs and making the programmer's intention clearer, as well as performance.
well... why should the compiler ever expect or not expect a part to be dynamically? Somehow I can't think of how this way should work. Maybe I don't understand what you mean yet.
You can think of the current method resolution like this:
(1) send the types to the metaclass and have it figure out what method to invoke.
With the first proposal, this becomes:
(2) if (types & metaclass are as expected) { call associated method } else { send the types to the metaclass and have it figure out what method to invoke. }
The question is: if the programmer says they expect certain types & metaclass, but at runtime we find something different, is that an error? Sometimes it will be, sometimes it won't be. It depends on whether the programmer was thinking "these types will usually be what I said, but sometimes won't" vs. "from the way I designed the code, these expressions should always have these types. If they don't, something's wrong." For the latter, we get:
(3) if (types & metaclass are as expected) { call associated method } else { throw execption }
That makes the type declaration the same as an assertion. You could imagine having an optimized build which doesn't even check:
(4) call associated method
Of course, you'd only want to turn off the type checks after you've thoroughly debugged, profiled, and found them to be a bottleneck. (I don't understand why Java even has a switch to turn off all assertions globally; turning off the ones that aren't a bottleneck can only lead to confusing messages or even corrupt data. And it really boggles my mind that they're off by default. Oh well.)
Option (2) is essentially what call site caching does, where "expected" is what was seen last time. But it doesn't allow (3) or (4). Whether that's a problem or an advantage depends on your point of view. ;)
Best, Martin
--------------------------------------------------------------------- To unsubscribe from this list, please visit:







