3 ms·
> Ruby is a decent performer, but you really need to throw fast hardware at it for good performance. Everytime a performance thing comes up I still think "Try
by rurounijones 14y ago
> Ruby is a decent performer, but you really need to throw fast hardware at it for good performance.
Everytime a performance thing comes up I still think "Try JRuby if it is that much of a problem"
Of course there are downsides but the code itself is not one of them. Most apps will run on JRuby without trouble without any conversion work.
The biggest obstacle I think is the switch from things like passenger / unicorn to totally unfamiliar servers like trinidad or torquebox (and the inevitable breakdown of jruby to java abstractions when you want to try advanced stuff and you have to learn java'isms like JMX etc.)
It didn't actually occur too strongly in this case but if ever I see a blog post about "Ruby didn't perform well enough" and they DIDN'T give jruby a try then my forehead gets a slapping.
JRuby - The forgotten option between more hardware and switching to a different language.
[Edit] Actually I should clarify, I have not yet compared ruby2 vs jruby and the applications I write tend to be very multi-threaded which plays into jruby's hands.
- bad_user 14y agoJRuby is really cool, however whenever I tried using it, well it was painful. It's not JRuby's fault as the devs did a phenomenal job on making it a first-class Ruby implementation, but you always have issues with its startup time added on top of the already awful startup time of Bundler/Rails, or with incompatibilities with libraries, or with libraries behaving differently or being incomplete on top JRuby versus Ruby MRI, or with instances in which you have to mix Maven or Jars with Bundler / RubyGems and so on. In the end, for new projects if you want to use the JVM, it's way better to use a language that was grown on top of the JVM. Like Scala or Clojure, or maybe even Java 8 when it comes out. Which is exactly what I personally did, being tired of the limitations that the reference Python/Ruby interpreters have.
- rurounijones 14y agoI actually know of a few people who use MRI on their local machines and JRuby on the servers. Not ideal but one option. Regarding mixing jars / maven and bundler. Well to be honest I have never been in that position w.r.t maven but including jars in a project has never really been a problem for me. (Plus on MRI those jars wouldn't have been available in the first place!)
- bad_user 14y agoI ended up with a mix when I wanted to run my app on top of a Jetty server. There are projects like jetty-rackup, but when you're on top of the JVM sometimes you feel the need to throw a servlet for a problematic endpoint in there, or some middleware like a filter that you could use for websockets or some library that doesn't already have wrappers packed up as a gem and so on. JRuby is great, all I'm saying is that when you feel the taste of a competent virtual machine there's no going back :-)
- bascule 14y agoYou seem to be confused. Clojure startup time is actually worse than JRuby, especially when you throw a tool like Leiningen into the mix: http://martinsprogrammingblog.blogspot.com/2012/02/why-is-clojure-so-slow.html http://martinsprogrammingblog.blogspot.com/2012/02/why-is-cl...
- sams99 14y agonot the case for us, Ruby 1.9.3 outperformed latest JRuby for us. Ruby 2.0 completely smoked it (and with GC tuning and tcmalloc even more), we leverage a fair amount of native gems, like the oj json serializer and fast_xs. Trouble is we would need Java implementations of some key bits of functionality. Now I love Charlie's work and would port to JRuby in a blink if it was faster. But as it is now, for us, it is not.
- rurounijones 14y agoActually yes I should have mentioned that I hadn't compared ruby2 and jruby, mea culpa.
- abc_lisper 14y agoIdk about you, here's what I found: http://benchmarksgame.alioth.debian.org/u32/benchmark.php?test=all&lang=jruby&lang2=yarv http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...
- sams99 14y agoKeep in mind, the only benchmark I really care about is Discourse itself, I am sure that in many micro benchmarks JRuby is faster and/or slower
- deleted 14y ago[deleted]
- FooBarWidget 14y agoPhusion Passenger 4 supports JRuby (and Rubinius): http://blog.phusion.nl/2012/10/30/phusion-passenger-4-0-supports-jruby-rubinius/ http://blog.phusion.nl/2012/10/30/phusion-passenger-4-0-supp...
- rurounijones 14y agoHoly hell, how did I miss that? Great news!
- rschmitty 14y agoI've been loving Passenger 4 so far, multiple ruby support is great. Thank you for your efforts and advancements with passenger.