PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > Ruby vs JRuby Performance
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Ruby vs JRuby Performance

Réponse
 
LinkBack Outils de la discussion
Vieux 09/06/2008, 14h36   #1
Victor Reyes
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Ruby vs JRuby Performance

[Note: parts of this message were removed to make it a legal post.]

I knew that there was a penalty to be paid when running JRuby, but I did not
know how high.
I developed a Sudoku solver, which actually solves simple to medium
difficult puzzles. I am still struggling to make it solve "hard" problems.
I just installed JRuby yesterday and wanted to compare it against Ruby.

I executed the same program:

The results are in:

ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

*Ruby:
ruby sudoku01final.rb
Elapsed Time: 0.437 Secs*

jruby -v
ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
*JRuby:
jruby sudoku01final.rb
Elapsed Time: 1.058 Secs*

BTW, there is no GUI in my program. I hope to learn the GUI part with JRuby.
That's the main reason why I downloaded JRuby, NetBeans, Java JDK/JRE, Etc.
I guess there is trade-off which one must be willing to accept.

Am I in the ball-park?

Regards,

Victor

  Réponse avec citation
Vieux 09/06/2008, 15h11   #2
Jochen Theodorou
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby vs JRuby Performance

Victor Reyes schrieb:
[...]
> ruby -v
> ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
>
> *Ruby:
> ruby sudoku01final.rb
> Elapsed Time: 0.437 Secs*
>
> jruby -v
> ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
> *JRuby:
> jruby sudoku01final.rb
> Elapsed Time: 1.058 Secs*


jruby has certainly higher startup costs than native Ruby, but that does
not mean its overall performance is bad. I suggest you modify the
program so it runs for example 10 times and then run again. I am sure
the JRuby program will be very much below 10s

bye Jochen
  Réponse avec citation
Vieux 09/06/2008, 15h25   #3
ThoML
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby vs JRuby Performance

> jruby -v
> ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
> *JRuby:
> jruby sudoku01final.rb
> Elapsed Time: 1.058 Secs*


Try to run it with jruby -J-server ...

  Réponse avec citation
Vieux 09/06/2008, 15h26   #4
M. Edward (Ed) Borasky
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby vs JRuby Performance

Victor Reyes wrote:
> I knew that there was a penalty to be paid when running JRuby, but I did not
> know how high.
> I developed a Sudoku solver, which actually solves simple to medium
> difficult puzzles. I am still struggling to make it solve "hard" problems.
> I just installed JRuby yesterday and wanted to compare it against Ruby.
>
> I executed the same program:
>
> The results are in:
>
> ruby -v
> ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
>
> *Ruby:
> ruby sudoku01final.rb
> Elapsed Time: 0.437 Secs*
>
> jruby -v
> ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
> *JRuby:
> jruby sudoku01final.rb
> Elapsed Time: 1.058 Secs*
>
> BTW, there is no GUI in my program. I hope to learn the GUI part with JRuby.
> That's the main reason why I downloaded JRuby, NetBeans, Java JDK/JRE, Etc.
> I guess there is trade-off which one must be willing to accept.
>
> Am I in the ball-park?
>
> Regards,
>
> Victor
>

Send the source to Charlie Nutter ... he is always looking for jRuby
performance test cases.

  Réponse avec citation
Vieux 09/06/2008, 15h44   #5
Lloyd Linklater
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby vs JRuby Performance

Victor Reyes wrote:
> I knew that there was a penalty to be paid when running JRuby, but I did
> not
> know how high.
> I developed a Sudoku solver, which actually solves simple to medium
> difficult puzzles. I am still struggling to make it solve "hard"
> problems.
> I just installed JRuby yesterday and wanted to compare it against Ruby.
>
> I executed the same program:
>
> The results are in:
> *Ruby:
> ruby sudoku01final.rb
> Elapsed Time: 0.437 Secs*
>
> jruby -v
> ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
> *JRuby:
> jruby sudoku01final.rb
> Elapsed Time: 1.058 Secs*
>
> Am I in the ball-park?


According to the metrics posted here, JRuby runs about twice as fast,
takes longer to load and uses a lot more memory. Here is a little
something on the metrics:

http://www.ruby-forum.com/topic/129990#new
http://www.ruby-forum.com/topic/129996#new
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 09/06/2008, 17h26   #6
Victor Reyes
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby vs JRuby Performance

[Note: parts of this message were removed to make it a legal post.]

*Ruby vs JRuby Performance <http://www.ruby-forum.com/topic/155783#686221>*
Posted by Victor Reyes (Guest)
on 09.06.2008 15:41
[image: (Received via mailing list)]

I knew that there was a penalty to be paid when running JRuby, but I did
not
know how high.
I developed a Sudoku solver, which actually solves simple to medium
difficult puzzles. I am still struggling to make it solve "hard"

problems.
I just installed JRuby yesterday and wanted to compare it against Ruby.

I executed the same program:

The results are in:

ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

*Ruby:
ruby sudoku01final.rb
Elapsed Time: 0.437 Secs*

jruby -v
ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
*JRuby:
jruby sudoku01final.rb
Elapsed Time: 1.058 Secs*

BTW, there is no GUI in my program. I hope to learn the GUI part with

JRuby.
That's the main reason why I downloaded JRuby, NetBeans, Java JDK/JRE,
Etc.
I guess there is trade-off which one must be willing to accept.

Am I in the ball-park?

Regards,

Victor

Reply with quote<http://www.ruby-forum.com/topic/155783?reply_to=686221#postform>
*Re: Ruby vs JRuby Performance<http://www.ruby-forum.com/topic/155783#686235>
*
Posted by Jochen Theodorou (Guest)
on 09.06.2008 16:15
[image: (Received via mailing list)]

Victor Reyes schrieb:
[...]
> jruby sudoku01final.rb
> Elapsed Time: 1.058 Secs*


jruby has certainly higher startup costs than native Ruby, but that does

not mean its overall performance is bad. I suggest you modify the
program so it runs for example 10 times and then run again. I am sure
the JRuby program will be very much below 10s

bye Jochen

Reply with quote<http://www.ruby-forum.com/topic/155783?reply_to=686235#postform>
*Re: Ruby vs JRuby Performance<http://www.ruby-forum.com/topic/155783#686241>
*
Posted by M. Edward (Ed) Borasky (Guest)
on 09.06.2008 16:28
[image: (Received via mailing list)]

Victor Reyes wrote:
> ruby -v
> Elapsed Time: 1.058 Secs*
>


Send the source to Charlie Nutter ... he is always looking for jRuby
performance test cases.

Reply with quote<http://www.ruby-forum.com/topic/155783?reply_to=686241#postform>
*Re: Ruby vs JRuby Performance<http://www.ruby-forum.com/topic/155783#686245>
*
Posted by ThoML (Guest)
on 09.06.2008 16:31

> jruby -v
> ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
> *JRuby:
> jruby sudoku01final.rb
> Elapsed Time: 1.058 Secs*


Try to run it with jruby -J-server ...

Reply with quote<http://www.ruby-forum.com/topic/155783?reply_to=686245#postform>
*Re: Ruby vs JRuby Performance<http://www.ruby-forum.com/topic/155783#686249>
*
Posted by Lloyd Linklater (lloyd <http://www.ruby-forum.com/user/show/6864>)

on 09.06.2008 16:44

Victor Reyes wrote:
> I knew that there was a penalty to be paid when running JRuby, but I did
> not
> know how high.
> I developed a Sudoku solver, which actually solves simple to medium
> difficult puzzles. I am still struggling to make it solve "hard"
> problems.
> I just installed JRuby yesterday and wanted to compare it against Ruby.
>
> I executed the same program:
>
> The results are in:
> *Ruby:
> ruby sudoku01final.rb
> Elapsed Time: 0.437 Secs*
>
> jruby -v
> ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
> *JRuby:
> jruby sudoku01final.rb
> Elapsed Time: 1.058 Secs*
>
> Am I in the ball-park?


According to the metrics posted here, JRuby runs about twice as fast,
takes longer to load and uses a lot more memory. Here is a little
something on the metrics:

http://www.ruby-forum.com/topic/129990#new
http://www.ruby-forum.com/topic/129996#new


================================================== ====================================

Team,

First, thank you for all your comments.

As suggested by JoChen, I executed the program under JRuby 14 times.

To be fair to Ruby, I also executed it 14 times under Ruby.
You can see the results below.

As suggested by Ed Borasky, I will send the code to Charlie Nutter, if
I can get his email. Otherwise I can post it here. It is not great

code at all, but it is doing the work for now.

I executed the program using *jruby -J-server* as suggested by ThoML
and results are catastrophic! See the number belows! I only ran it 6
times.
I also can't believe that jruby has been clocked at twice the speed of
ruby since after all, jruby has more overhead than ruby. Then again,

I am not expert on the subject (or any subject).

*JRuby executions:
*Elapsed Time: 0.888
Elapsed Time: 0.881
Elapsed Time: 0.977
Elapsed Time: 0.888
Elapsed Time: 0.872

Elapsed Time: 0.884
Elapsed Time: 0.869
Elapsed Time: 0.892
Elapsed Time: 0.876
Elapsed Time: 0.872
Elapsed Time: 0.882
Elapsed Time: 0.882
Elapsed Time: 0.867
Elapsed Time: 0.881
Elapsed Time: 0.906

Elapsed Time: 0.881

*Ruby executions:*
Elapsed Time: 0.422
Elapsed Time: 0.391
Elapsed Time: 0.407
Elapsed Time: 0.406
Elapsed Time: 0.407

Elapsed Time: 0.422
Elapsed Time: 0.406
Elapsed Time: 0.438
Elapsed Time: 0.406
Elapsed Time: 0.406
Elapsed Time: 0.406
Elapsed Time: 0.39
Elapsed Time: 0.406
Elapsed Time: 0.406
Elapsed Time: 0.422

Elapsed Time: 0.39

*jruby -J-server sudoku01final.rb*
Elapsed Time: 2.474
Elapsed Time: 2.467
Elapsed Time: 2.347
Elapsed Time: 2.404
Elapsed Time: 2.326
Elapsed Time: 2.414

Thank you

Victor

  Réponse avec citation
Vieux 09/06/2008, 17h58   #7
ThoML
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby vs JRuby Performance

> I executed the program using *jruby -J-server* as suggested by ThoML
> and results are catastrophic! See the number belows! I only ran it 6
> times.


I didn't realize how small the numbers already are. Have you checked
the result of

time ruby -v
time jruby -v

just to get a feeling for how much time is spent in startup alone?
  Réponse avec citation
Vieux 09/06/2008, 20h56   #8
Jochen Theodorou
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby vs JRuby Performance

Victor Reyes schrieb:
[...]
> As suggested by JoChen, I executed the program under JRuby 14 times.
>
> To be fair to Ruby, I also executed it 14 times under Ruby.
> You can see the results below.
>
> As suggested by Ed Borasky, I will send the code to Charlie Nutter, if
> I can get his email. Otherwise I can post it here. It is not great
>
> code at all, but it is doing the work for now.
>
> I executed the program using *jruby -J-server* as suggested by ThoML
> and results are catastrophic! See the number belows! I only ran it 6
> times.
> I also can't believe that jruby has been clocked at twice the speed of
> ruby since after all, jruby has more overhead than ruby. Then again,
>
> I am not expert on the subject (or any subject).
>
> *JRuby executions:
> *Elapsed Time: 0.888
> Elapsed Time: 0.881

[...]
> Elapsed Time: 0.881
>
> *Ruby executions:*
> Elapsed Time: 0.422
> Elapsed Time: 0.391

[...]
> Elapsed Time: 0.39
>
> *jruby -J-server sudoku01final.rb*
> Elapsed Time: 2.474

[...]
> Elapsed Time: 2.414


well, looking at these numbers I would suggest you subscribe to the
jruby mailing list and ask why jruby is 100% slower than ruby The
server mode really looks awful... They need to know about this!

bye Jochen
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h30.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16266 seconds with 16 queries