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 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
Giles B. wrote:
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.