[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

jruby <=> prime time?

Giles Bowkett

10/26/2006 2:27:00 AM

I've got a project for which I might need to write a fast and very small server.

I was initially thinking, that if I do in fact need to do this, that I
would have to choose Python over Ruby for the server, because it would
be faster.

however -- is JRuby fast enough for something like this?

(because it would definitely be cool if it was.)

--
Giles Bowkett
http://www.gilesg...

2 Answers

Kev Jackson

10/26/2006 4:33:00 AM

0

JRuby can be almost as fast as Java. So basically if you think Java
is fast enough for writing your server, then JRuby *should* be fast
enough.

Given the latest release of BSF (bean scripting framework), the
following languages can also be used on the JVM with little effort

- js
- ruby
- beanshell
- judoscript
- python
- nice
- pnuts
- Kawa (scheme on Java, doesn't use bsf)
+ more I can't remember now :)

Bottom line, if Java would be fast enough, then most of the above
would be fast enough - the JRuby devs are probably lurking around here
and can give you a more informed delta for the difference in execution
of 'normal' Java vs JRuby

Thanks,
Kev

Charles Oliver Nutter

10/26/2006 4:49:00 AM

0

Giles Bowkett wrote:
> I've got a project for which I might need to write a fast and very small
> server.
>
> I was initially thinking, that if I do in fact need to do this, that I
> would have to choose Python over Ruby for the server, because it would
> be faster.
>
> however -- is JRuby fast enough for something like this?
>
> (because it would definitely be cool if it was.)
>

JRuby executing straight-up Ruby code is still a few times slower than
normal Ruby. We're working on a few options to speed it up, but there's
a bit of work to do. However when a Java library or external resource
(IO, etc) is involved, however, we usually are comparable or faster. For
example, a deep iterative fib starts winning in JRuby around the
300000th fib because of Java's fast BigInteger class.

If you're doing mostly straight Java code and integrating it through a
thin Ruby layer, it will likely be faster than writing the same service
in pure Ruby...either on the C version or on JRuby.

--
Charles Oliver Nutter, JRuby Core Developer
headius@headius.com -- charles.nutter@sun.com
Blogging at headius.blogspot.com