Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ruby on Rails out of the box gets a lot of bad rep for being slow and non-performant. Has anyone replaced MRI with JRuby or TruffleRuby to mitigate that? Were there any significant "gotchas" with integrating it?


I did a POC getting a monorail running on JRuby (probably 6?) years ago. It wasn't for performance reasons (though we did have some GC issues, which JRuby might have helped). It was because we had to integrate with some services which only vended APIs via JARs.

The biggest dealbreaker was that (like most Rails apps) we had a ton of gems, some of which had native extensions. JRuby doesn't support C native extensions.

In the end, it was way easier (and a much less risky change) to spin up our own Java REST APIs in front of those JARs, and let our MRI Rails app integrate with them by talking to those REST endpoints.

Just for fun, I also tried using dRuby so an MRI Rails app and a small JRuby (non-Rails) process could communicate idiomatically. It was cool, but I'm pretty sure dRuby was eventually deprecated.


Been following TruffleRuby, I did recently just spin up a super dummy app where I swapped out mysql to postgresql, made a migration to create a table and generated some fake data. Opened a console and ActiveRecord was able to query. Thats a big step forward as they had said the ActiveRecord connections were some of the biggest hurdles.

Does this story answer your question about performance? Not really, but if I wanted to dive deeper (which I do at some point!) I think TruffleRuby is a real option.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: