

![]() | 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: | Jochen Theodorou (blac...@gmx.org) | |
| Date: | Feb 27, 2008 3:03:13 am | |
| List: | org.codehaus.groovy.dev | |
Martin C. Martin schrieb:
Jochen Theodorou wrote:
Martin C. Martin schrieb: [...]
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?
if you want to keep the current way, then no. Not unless you add additional syntax for extended checks.
Sorry, I'm not being very clear. When I said "error" I was talking about the programmer's intentions, I should have said "mistake" instead. In other words, I'm saying there are times when you want the extended checks (and other times you don't.) In those cases, it would be more helpful for the runtime to signal an error than to continue on with unintended (but valid according to the specs) semantics.
well, if the rhs type is known and the lhs has a type, then we could check if the types are assignable, because you can not change the assignment at runtime. But to what cases would this apply to?
int i="aa"
the rhs is a constant, so we know the type for sure, we could throw an error here.
int i = foo()
In this case you would normally use the return type of foo() to do the check, but we that type is always to take of a grain of salt. If foo returns Object, then the cast may succeed, if foo() return String, hen it still might be replaced at runtime... We can't be sure if it will fail.
int i = j
in this case, if j is a local variable, we normally have a type, and we could say if j is a String we can throw an error. If j is an Object we can not. If j is a field, the same logic applies and if j is a property, then we can't do anything, because it is just like a method call.
So as I see it such a check is possible in some cases, but they are not very useful. We could check assignment of constants, local variables and fields.
[...]
It sounds like you don't want to give the programmer the ability to override the default behavior. You don't want the programmer to be able to say "just find the method based on these types. Even if you can't prove it at compile time, trust me, these really are the types."
because such a call could not be influenced by any dynamic mechanism we have. I am not saying I do not want that, but we must be careful how to do something like that.
You always want to check the declared types, in case the programmer makes a mistake. Essentially, when it comes to typing for efficiency, you never want to disable what amount to assertions. Am I understanding correctly?
I am not checking the types in case the programmer makes a mistake, I must check the types, because the runtime type might differ form the expected type. For example if you declare something to be Object, then it could still be a String or a JFrame or whatever. If I now call a method that is overloaded with a String parameter, then I have to call this method instead if my argument is a String.
I can see why you'd want to do that in places where performance isn't critical, as with any assertion. Perhaps it is a differing philosophy, but it makes sense to me to be able to turn those off in the small amount of code that's a performance bottleneck.
Of course I am concerned about performance, but in the first place I am concerned about correctness. Of course, if the method call is annotated or something so that the normal logic does not apply, then we can do other things, but such an annotation is a syntactic element that is always not so easy to add. You see there are two levels here, the implementation and the syntax. A change to the implementation is easy, as long as the semantics are the same. A change to the syntax is not easy, because it must fit into many heads. Take the annotation Alex proposed for example. No developer is against enabling direct calls if they are marked and recognizable and such. But to be recognized you need a syntax and the syntax is the problem.
So I am trying to make the implementation side faster, which reduces the need for such a syntax.
bye blackdrag
-- Jochen "blackdrag" Theodorou The Groovy Project Tech Lead (http://groovy.codehaus.org) http://blackdragsview.blogspot.com/ http://www.g2one.com/
--------------------------------------------------------------------- To unsubscribe from this list, please visit:







