Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > JRuby performance questions answered

Reply
Thread Tools

JRuby performance questions answered

 
 
Charles Oliver Nutter
Guest
Posts: n/a
 
      10-31-2007
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...rformance.html

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

http://headius.blogspot.com

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...pressions.html
(toward the bottom of the post are updated Rails numbers)

http://blog.nicksieger.com/articles/...ls-fast-enough

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

 
Reply With Quote
 
 
 
 
Paul Stickney
Guest
Posts: n/a
 
      10-31-2007
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.

 
Reply With Quote
 
 
 
 
Charles Oliver Nutter
Guest
Posts: n/a
 
      11-01-2007
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

 
Reply With Quote
 
znmeb@cesmail.net
Guest
Posts: n/a
 
      11-01-2007
Quoting Charles Oliver Nutter <(E-Mail Removed)>:

> 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



 
Reply With Quote
 
Charles Oliver Nutter
Guest
Posts: n/a
 
      11-01-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Quoting Charles Oliver Nutter <(E-Mail Removed)>:
>
>> 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

 
Reply With Quote
 
William James
Guest
Posts: n/a
 
      11-01-2007
On Oct 31, 11:24 pm, Charles Oliver Nutter <(E-Mail Removed)>
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

 
Reply With Quote
 
vjoel@path.berkeley.edu
Guest
Posts: n/a
 
      11-01-2007
William James wrote:
> On Oct 31, 11:24 pm, Charles Oliver Nutter <(E-Mail Removed)>
> 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

 
Reply With Quote
 
charles.nutter@sun.com
Guest
Posts: n/a
 
      11-02-2007
William James wrote:
> On Oct 31, 11:24 pm, Charles Oliver Nutter <(E-Mail Removed)>
> 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

 
Reply With Quote
 
znmeb@cesmail.net
Guest
Posts: n/a
 
      11-02-2007
Quoting Charles Oliver Nutter <(E-Mail Removed)>:

> (E-Mail Removed) wrote:
>> Quoting Charles Oliver Nutter <(E-Mail Removed)>:
>>
>>> 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.


 
Reply With Quote
 
mfp@acm.org
Guest
Posts: n/a
 
      11-02-2007
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 <(E-Mail Removed)>
> >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://eigenclass.org

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[JRuby] JRuby perf questions answered Charles Oliver Nutter Ruby 7 11-01-2007 05:11 AM
FAQ Topic - I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? FAQ server Javascript 7 02-10-2007 02:55 PM
FAQ Topic - I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? FAQ server Javascript 0 12-04-2006 12:00 AM
FAQ Topic - I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? FAQ server Javascript 0 10-06-2006 11:00 PM
FAQ Topic - I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? FAQ server Javascript 0 08-09-2006 11:00 PM



Advertisments