[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

JRuby performance questions answered

Charles Oliver Nutter

10/31/2007 6:01:00 PM

Many folks still seem to be in the dark about JRuby performance relative
to Ruby 1.8.x. I figured a short post with some basic info could start a
discussion for anyone wanting to know more.

Long story short, JRuby 1.1 is now generally faster than Ruby 1.8.6, and
for most execution benchmarks it is the fastest 1.8-compatible Ruby
implementation available. This is based on the YARV benchmarks, the
Alioth benchmarks, a number of benchmarks we created for JRuby, and a
few other external benchmarks we run from time to time. Many (most?) of
these are microbenchmarks, but a number are nontrivial code.

For example, M. Ed. Borasky's MatrixBenchmark:

JRuby:
Hilbert matrix of dimension 64 times its inverse = identity? true
18.784000 0.000000 18.784000 ( 18.784000)

Ruby 1.8.6:
Hilbert matrix of dimension 64 times its inverse = identity? true
32.560000 0.110000 32.670000 ( 32.776915)

Or the YARV "pentomino" benchmark:

~/NetBeansProjects/jruby $ time jruby -J-server
test/bench/yarv/bm_app_pentomino.rb

real 1m31.770s
user 1m32.016s
sys 0m1.278s
~/NetBeansProjects/jruby $ time ruby test/bench/yarv/bm_app_pentomino.rb

real 1m48.100s
user 1m47.489s
sys 0m0.287s

Ola Bini of the JRuby team recently ran all the YARV benchmarks and
reported the results here:

http://ola-bini.blogspot.com/2007/10/mystery-expos-on-jruby-perfor...

And I periodically post about performance progress on my blog here:

http://headius.bl...

I expect we'll see Alioth updated soon after the 1.1 or 1.1 beta 1 releases.

What about Rails?

One of the biggest uses for JRuby recently has been Rails. Rails
performance is a more complicated thing to measure; there's a lot of
non-execution bottlenecks that get in the way. But both Ola and Nick
Sieger (also of JRuby team) have found that JRuby on Rails performance
is either very near or exceeding Ruby 1.8.x on Rails:

http://ola-bini.blogspot.com/2007/10/current-state-of-regular-expres...
(toward the bottom of the post are updated Rails numbers)

http://blog.nicksieger.com/articles/2007/10/25/jruby-on-rails-f...

Rails is probably the ultimate real-world benchmark, and we're excited
to see that JRuby's starting to pass Ruby 1.8.x performance here as well.

I won't drag this on any longer, but I'd encourage you to try out your
own Ruby code and let us know how it performs. We've spent a lot of time
on performance issues for the 1.1 release, and have many future plans to
continue increasing performance. We want your input.

Many people believed we'd never be faster than the C implementation, and
many still think we're slower. Now that I've set that record straight,
any questions?

- Charlie

16 Answers

Paul Stickney

10/31/2007 8:49:00 PM

0

Will JRuby support continuations (via callcc)?

I've been reading about Actors in Scala recently and the technical
documentation mentioned problems with trying to implement
continuations on the JVM due to lack of stack manipulation.

Charles Oliver Nutter

11/1/2007 4:24:00 AM

0

Paul Stickney wrote:
> Will JRuby support continuations (via callcc)?
>
> I've been reading about Actors in Scala recently and the technical
> documentation mentioned problems with trying to implement
> continuations on the JVM due to lack of stack manipulation.

Neither JRuby nor XRuby nor IronRuby nor Ruby.NET will support
continuations in the near future. However, there is research happening
now to support continuations on the JVM...if that takes, we'll piggy
back off that support.

- Charlie

M. Edward (Ed) Borasky

11/1/2007 5:25:00 AM

0

Quoting Charles Oliver Nutter <charles.nutter@sun.com>:

> Many people believed we'd never be faster than the C implementation,
> and many still think we're slower. Now that I've set that record
> straight, any questions?

1. How long will it be before Alioth has some *reasonable* numbers for
jRuby? As of yesterday, they still have you significantly slower than
MRI. So I need to take jRuby out of my slides for RubyConf :) ... I

2. I haven't actually been benchmarking jRuby recently ... too busy
profiling MRI. :)

3. I'm using the "Pet Store" benchmark for Rails. It's as close to a
"real Rails benchmark" as anything I can find.

4. How's your performance on a SPARC relative to MRI?
>
> - Charlie


Charles Oliver Nutter

11/1/2007 6:16:00 AM

0

znmeb@cesmail.net wrote:
> Quoting Charles Oliver Nutter <charles.nutter@sun.com>:
>
>> Many people believed we'd never be faster than the C implementation,
>> and many still think we're slower. Now that I've set that record
>> straight, any questions?
>
> 1. How long will it be before Alioth has some *reasonable* numbers for
> jRuby? As of yesterday, they still have you significantly slower than
> MRI. So I need to take jRuby out of my slides for RubyConf :) ... I

The current published Alioth numbers are based on JRuby 1.0(ish), which
was generally 2-3x slower than MRI. I'm hoping the numbers will be
updated soon after the 1.1 releases...but it probably won't happen until
1.1 final comes out in December. If someone else wants to re-run them
for us, it would make us very happy :)

> 2. I haven't actually been benchmarking jRuby recently ... too busy
> profiling MRI. :)

Well, we know there's still a lot we can do for JRuby
performance...including not only the 1.9 benchmarks, but a number of
additional ideas we have that won't affect 1.8 compatibility.

> 3. I'm using the "Pet Store" benchmark for Rails. It's as close to a
> "real Rails benchmark" as anything I can find.

Yeah, that's what Ola's been using, and we're *real close* to matching
MRI on that one right now. Still hunting for bottlenecks.

> 4. How's your performance on a SPARC relative to MRI?

Haven't given it a try...I don't have access to a good sparc box at the
moment (and yes, I know...I work at Sun, so I can have a sparc by
snapping my fingers...it's a matter of having time to monkey with it).

- Charlie

William James

11/1/2007 7:02:00 PM

0

On Oct 31, 11:24 pm, Charles Oliver Nutter <charles.nut...@sun.com>
wrote:

> Neither JRuby nor XRuby nor IronRuby nor Ruby.NET will support

"Neither ... nor ..." is for two alternatives. Perhaps this will
suffice.

None of JRuby or XRuby or IronRuby or Ruby.NET will support

Joel VanderWerf

11/1/2007 7:58:00 PM

0

William James wrote:
> On Oct 31, 11:24 pm, Charles Oliver Nutter <charles.nut...@sun.com>
> wrote:
>
>> Neither JRuby nor XRuby nor IronRuby nor Ruby.NET will support
>
> "Neither ... nor ..." is for two alternatives. Perhaps this will
> suffice.
>
> None of JRuby or XRuby or IronRuby or Ruby.NET will support

None of snow or rain or heat or gloom of night stays these couriers from
the swift completion of their appointed rounds.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Charles Oliver Nutter

11/2/2007 12:36:00 AM

0

William James wrote:
> On Oct 31, 11:24 pm, Charles Oliver Nutter <charles.nut...@sun.com>
> wrote:
>
>> Neither JRuby nor XRuby nor IronRuby nor Ruby.NET will support
>
> "Neither ... nor ..." is for two alternatives. Perhaps this will
> suffice.
>
> None of JRuby or XRuby or IronRuby or Ruby.NET will support

Perhaps

JRuby, XRuby, IronRuby, Ruby.NET; none of them will support

Too poetic?

- Charlie

M. Edward (Ed) Borasky

11/2/2007 4:30:00 AM

0

Quoting Charles Oliver Nutter <charles.nutter@sun.com>:

> znmeb@cesmail.net wrote:
>> Quoting Charles Oliver Nutter <charles.nutter@sun.com>:
>>
>>> Many people believed we'd never be faster than the C implementation,
>>> and many still think we're slower. Now that I've set that record
>>> straight, any questions?
>>
>> 1. How long will it be before Alioth has some *reasonable* numbers
>> for jRuby? As of yesterday, they still have you significantly
>> slower than MRI. So I need to take jRuby out of my slides for
>> RubyConf :) ... I
>
> The current published Alioth numbers are based on JRuby 1.0(ish), which
> was generally 2-3x slower than MRI. I'm hoping the numbers will be
> updated soon after the 1.1 releases...but it probably won't happen
> until 1.1 final comes out in December. If someone else wants to re-run
> them for us, it would make us very happy :)

I can't help you with that, but if you'll give me the numbers you do
have (time in seconds for each benchmark on the latest jRuby, MRI and
KRI on a common platform) I'll run the boxplots off and post them to
the list.


Mauricio Fernández

11/2/2007 11:13:00 AM

0

On Fri, Nov 02, 2007 at 09:35:44AM +0900, Charles Oliver Nutter wrote:
> William James wrote:
> >On Oct 31, 11:24 pm, Charles Oliver Nutter <charles.nut...@sun.com>
> >wrote:
> >
> >>Neither JRuby nor XRuby nor IronRuby nor Ruby.NET will support
> >
> >"Neither ... nor ..." is for two alternatives. Perhaps this will
> >suffice.
> >
> >None of JRuby or XRuby or IronRuby or Ruby.NET will support
>
> Perhaps
>
> JRuby, XRuby, IronRuby, Ruby.NET; none of them will support
>
> Too poetic?

The original polysyndeton conveyed the intended meaning effectively IMO.
How thin is the line between a deliberate figure of speech and a grammatical
accident!

This doesn't sound too bad to me, but I'm no native speaker:
"Neither JRuby nor XRuby, IronRuby or Ruby.NET will ..."

"Or" must bind more tightly than "nor" there in order for the corresponding
logical proposition to be correct:

AND(NOT(JRuby), NOT(OR(XRuby, IronRuby, Ruby.NET)))

"None of JRuby, XRuby, IronRuby or Ruby.NET will ..." and
"As for JRuby, XRuby, IronRuby and Ruby.NET, none [of them] will ..."
seem OK too.

--
Mauricio Fernandez - http://eige...

Joel VanderWerf

11/2/2007 7:41:00 PM

0

Mauricio Fernandez wrote:
> On Fri, Nov 02, 2007 at 09:35:44AM +0900, Charles Oliver Nutter wrote:
>> William James wrote:
>>> On Oct 31, 11:24 pm, Charles Oliver Nutter <charles.nut...@sun.com>
>>> wrote:
>>>
>>>> Neither JRuby nor XRuby nor IronRuby nor Ruby.NET will support
>>> "Neither ... nor ..." is for two alternatives. Perhaps this will
>>> suffice.
>>>
>>> None of JRuby or XRuby or IronRuby or Ruby.NET will support
>> Perhaps
>>
>> JRuby, XRuby, IronRuby, Ruby.NET; none of them will support
>>
>> Too poetic?
>
> The original polysyndeton conveyed the intended meaning effectively IMO.
> How thin is the line between a deliberate figure of speech and a grammatical
> accident!

I agree, and thanks for teaching me a new word.

> This doesn't sound too bad to me, but I'm no native speaker:
> "Neither JRuby nor XRuby, IronRuby or Ruby.NET will ..."

That could sound like the "Neither ... nor ..." clause modifies
IronRuby. As in:

Neither fish nor fowl, greens or libertarians will be the first choice
of voters who are repelled by two-party politics.

It might not even be grammatical, but it is clear that we are not
talking about electing ducks and sturgeons. I'd rewrite it anyway.

> "Or" must bind more tightly than "nor" there in order for the corresponding
> logical proposition to be correct:

I don't think it works that way, at least as I hear it.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407