Add a comment. Active Oldest Votes. I think you pretty much nailed it. Improve this answer. Nick Sieger Nick Sieger 3, 18 18 silver badges 13 13 bronze badges. As far as hosting is concerned, you have to put your app in some sort of java container, which I personally find to be far less straightforward than using something like passenger for Rack apps I use JRuby for an app as we communicate over JMS and it works fine, but if I wasn't using any Java I would certainly stick to CRuby.
However, it has a great big lock the GIL around the which effectively makes a lot of code single-threaded in practice. It would still be fair to say that JRuby is one of the few implementations that takes advantage of native threads :- — telent. For some reason I could never get Oracle drivers to work properly :- — Steven. Steven: Do you think the same company owning both Oracle and Java will help? Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Small performance benchmarks are often not the best way to assess practical performance, but one place the JVM is known to perform very well compared to interpreted languages is in long-running server applications, where adaptive optimizations can make a big difference. Notably, an untuned JVM process has a slow start-up time, and with JRuby, this can get even worse as lots of standard library code is loaded on start-up.
Either like this:. In my Jekyll use case, this change and some other small JVM parameter tweaking made a big difference. I was able to get the build time down from 45m 16s to 24m 1s. The --dev flag indicates to JRuby that you are running it in as a developer and would prefer quick startup time over absolute performance. If you get unexpected or non-deterministic results in your concurrent array usage, you should look at concurrent data structures for the JVM like ConcurrentHashMap or ConcurrentSkipListMap.
You may find that they not only fix the threading issues but could be orders of magnitude faster than the idiomatic Ruby way. Jekyll is not multi-threaded, however, so this is not an issue I needed to worry about. According to Wikipedia, these goals are:. Increased performance and better start-up time sound precisely like what we need to improve on JRuby, and this fact did not go unnoticed: TruffleRuby is a fork of JRuby that runs on GraalVM.
How can this be? The most obvious place where you see this difference is multi-process Ruby programs. And in fact, if you ignore language shoot-out games, where everything is a single process and instead compare an MRI multi-process approach to a TruffleRuby multi-threading approach, many advantages of the JVM seem to disappear.
This chart comes from Benoit Daloze 1 , the TruffleRuby lead. The benchmark in question is a long-running server-side application using a minimal web framework.
It is in the sweet spot of the Graal and TruffleRuby, with little code to JIT and much time to make up for a slow start. But even so, MRIRuby does well. Which brings me back to my original question: Why is JRuby slow for Jekyll? Stacks Follow I use this. What is JRuby? The Java version is tightly integrated with Java to allow both to script any Java class and to embed the interpreter into any Java application. See the docs directory for more information. JRuby is a tool in the Languages category of a tech stack.
What is the benefits of JRuby? Do you recommend JRuby? If I want to use ruby, I have to use just Ruby without other languages? Himalay Majumdar. The most important aspect of JRuby is that it is tightly integrated with Java that allows Java application talk to Ruby code. I dont think you need JRuby if you just need Ruby without integrating with any other language.
0コメント