Optimizing compiler

Does jruby already do something like what this fellow did for groovy?
http://chanwit.blogspot.com/2009/12/groovy-performance-update-long-running.html

Thanks.
-rp

Funny you should ask. I’ve just started playing with doing some
runtime-profiled optimizations to JRuby. It will be easier for us
since we have an interpreted mode and can easily go back and forth
from compiled to interpreted code if necessary.

Early results are a bit “best case”, but they’re pretty impressive:

The trick here is that whatever method was last cached at a call site
is used during compilation to do a direct invocation. These numbers
are likely to drop some since it’s missing the guard to ensure the
receiver is the correct type, but for cases that can be optimized this
far (probably at the user’s request) it’s quite a boost…this is
essentially matching Java performance for the same logic, and the
generated code is basically equivalent to what we’d write in Java
against Ruby objects.

There’s more coming too…invocations from Ruby to Java can be turned
into direct calls skipping reflection entirely and potentially
reducing the coercion and boxing required normally (for example,
calling a Java method with a literal string or number can just pass
that string or number through directly). And if the guards end up
being pretty cheap, we can iteratively improve the profiled
compilation over time.

Expect to see at least some of this available on master soon, and
probably a lot of it in 1.6.

On Fri, May 28, 2010 at 5:04 PM, Roger P. [email protected]
wrote:

  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Blog post on my experiments. Look for bits of this to start landing on
master very soon:

On Sat, May 29, 2010 at 2:28 AM, Charles Oliver N.
[email protected] wrote:

is used during compilation to do a direct invocation. These numbers
calling a Java method with a literal string or number can just pass


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email