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

Why not use the JVM (e.g. JRuby)? These problems have long been solved (if they ever occurred to start with.)


http://www.isrubyfastyet.com/ seems to show that Rails+JRuby performance remains disappointingly bad. The memory usage is kind of nuts too, not sure why it's so high.

Edit:

This page explains the high memory usage and it seems more reasonable now: https://github.com/jruby/jruby/wiki/Troubleshooting-Memory-U...


These benchmarks are uselessly bad:

- The client connections are run without concurrency, serially, on the same machine: https://github.com/brianhempel/isrubyfastyet/blob/master/run...

- The JIT is only given 3 seconds to warm up: https://github.com/brianhempel/isrubyfastyet/blob/master/run... -- HotSpot kicks ass, but not after only 3 seconds of serially issued requests.

- By running the tests single-threaded, they're throwing away one of the major wins of the JVM -- low overhead concurrency.


I think this would be a better benchmark than that one as it runs a more apples-apples comparison:

http://www.techempower.com/benchmarks/#section=data-r8&hw=i7...


I think a lot of Rubyists unfortunately don't write thread safe code :( I've worked on many Rails apps that have some mutable state on the ApplicationController and the models. Also, developing on the JVM requires a change in tooling that a lot of Rubyists aren't used to, as well as the slow JVM start up times which can make TDD with JRuby a pain. JRuby is consistently getting better, though.


> mutable state on the ApplicationController and the models

Well, mutable state on the models seems pretty fair, unless I'm misunderstanding you. It's rather unforgivable on ApplicationController though.

Edit: and the slow startup time doing TDD with JRuby was my primary complaint when I developed in it. Although iirc you can use nailgun or something to keep the JVM active and mitigate that pain.


Sorry, I meant mutable state on classes, which is just a sneaky way of having global state.


Can you give an example? I'm learning Rails and I'd like to avoid bad practices.


Is the JRuby environment sufficiently different that you can't TDD against MRI and then save JRuby for final validation testing and deployment? They shouldn't be that different, unless you're not writing pure ruby code.

Alternatively, Nailgun should reduce a lot of that pain. Effectively you have a running server instance of JVM and run some clients on it. That gives you JVM speed advantages without the slow startup. JRuby natively supports it: https://github.com/jruby/jruby/wiki/JRubyWithNailgun


Exactly. Jruby warbler rocks, create easily deployable artifacts jars, wars etc and you have rock solid JVM at your disposal.


Slow startup time for large ruby applications.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: