15 May 16:33
Re: [groovy-dev] invokedynamic: Is It What We Really Need?
From: Jochen Theodorou <blackdrag@...>
Subject: Re: [groovy-dev] invokedynamic: Is It What We Really Need?
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-05-15 14:33:36 GMT
Subject: Re: [groovy-dev] invokedynamic: Is It What We Really Need?
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-05-15 14:33:36 GMT
tugwilson schrieb:
> I have been thinking about possible reasons why we are seeing such a
> different level of performance with a similar technique.
>
> I think the crucial difference may be that I am making calls to static
> methods in my case statements whereas the Reflector made calls to instance
> methods. Hotspot can immediately see that it's always safe top inline a
> static method. For an instance method it has to worry about subclasses
> overloading it (Hotspot can and does deal with this, of course, but it's
> logically more costly and I would imagine it delays this optimisation until
> it's done the cheaper optimisations).
ok... but how do you make the call then? ah, wait, you mean the methods
you call are static, not the reflector method... hmm... that's something
that can be tested easily, or not?
> If this is the reason that I'm seeing better numbers it's entirely
> fortuitous. I chose static methods so that I could do super calls easier not
> because of any performance gain.
how do you do super calls in static methods? I mean ok, you give the
object you make the call on and all that... but:
class Foo{
def bar(){}
}
class Bar extend Foo{
def bar(){super.bar()}
}
now if this would actually become:
class Foo{
def bar(){}
static synthetic access$bar1(Foo f){f.bar()}
}
class Bar extend Foo{
def bar(){access$bar1(this)}
}
then nothing is gained... I mean that would end up with a stack
overflow, or not?
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:
http://xircles.codehaus.org/manage_email
RSS Feed