7 ms·
JRuby 1.7.0. Released
- lloeki 14y agoNot only does it default to 1.9 after one year, it catches up all the way to 1.9.3-p286, released only ten days ago.
- sheff 14y agoLooking forward to installing it and trying it out with Torquebox ( http://torquebox.org/ http://torquebox.org/ ) for a new project.
- mberning 14y agoJRuby is really great. I use it every day for both work and personal projects. Big thanks to all the contributors!
- ZitchDog 14y ago> InvokeDynamic support This is the big one, in my opinion. See here[1] for some benchmarks of JRuby + invokedynamic. We're talking orders of magnitude for some benchmarks. [1] http://blog.headius.com/2011/08/invokedynamic-in-jruby-constant-lookup.html http://blog.headius.com/2011/08/invokedynamic-in-jruby-const...
- igouy 14y agosome benchmarks from Wed, 10 Oct 2012 jruby-1.7.0.RC2 -Xcompile.invokedynamic=true http://shootout.alioth.debian.org/u32/jruby.php http://shootout.alioth.debian.org/u32/jruby.php
- ZitchDog 14y agoI guess I should have specified, I was thinking of the benchmarks vs non-invokedynamic JRuby. No intention of starting a benchmark war. Ruby 1.9 is fast too.
- igouy 14y agoOK. Back to August 29th, JRuby 1.7.0 preview2, invoke-dynamic=true on the right, the last number is elapsed time in seconds (so 451.046 vs 258.643 with invoke-dynamic=true) -- http://anonscm.debian.org/viewvc/shootout/shootout/website/websites/u32/data/data.csv?r1=1.1021&r2=1.1022 http://anonscm.debian.org/viewvc/shootout/shootout/website/w...
- igouy 14y agoI see that ViewVC link seems to have problems showing the diff at the moment, here are elapsed seconds (without invokedynamic and with invokedynamic) jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on Java HotSpot(TM) Server VM 1.7.0_09-b05 [linux-i386] invoke-dynamic= false true binarytrees #1 290.08 252.55 binarytrees #2 290.34 252.92 binarytreesredux #2 289.64 262.04 chameneosredux 31 39.85 32.73 fannkuchredux #2 1720.70 1481.23 fasta #6 372.59 418.07 fasta #5 294.54 270.02 fasta #1 278.98 260.14 knucleotide #2 428.75 377.28 knucleotide #1 470.40 461.46 mandelbrot #3 1404.58 1149.08 mandelbrot #1 2301.81 2167.50 meteor #1 17.59 17.42 meteor #2 13.19 13.37 nbody #1 678.62 568.72 pidigits #2 3.10 3.22 pidigits #3 25.89 25.73 pidigits #1 50.80 51.03 regexdna #1 78.76 78.60 regexdna #3 44.29 45.33 revcomp #2 24.05 24.49 spectralnorm #2 462.09 387.54 spectralnorm #1 496.94 438.55 YMMV
- deleted 14y ago[deleted]
- ksec 14y agoSo with about the same CPU time, JRuby will use up to 100x memory in worst case? Anyway Ruby 2.0 is suppose to solve the Ruby is Slow problem. although i have yet to see any evidence that will the case. Sigh.
- benmmurphy 14y agothese benchmarks also include the time it takes the vm to start up and may not include full JIT performance. locally in jruby pidigits.rb 2000 takes 4.132s, running it twice it takes 4.965s. jruby is quite annoying for running small little scripts because of the startup time but it an be quite nice for full applications.
- bascule 14y agoYes, each Ruby method needs to get executed 50 times to JIT to JVM bytecode, and from there it takes an additional 10,000 calls for HotSpot to JIT that to machine code. Any hotspots therefore need to be hit at least 10,050 times in order to be fully warmed up.
- mbell 14y agoJust start the JVM with -XX:CompileThreshold=<some_number> It only defaults to 10,000 when the JVM is running in server mode, its 1,500 when in client. Which mode a default install runs in is a bit wonky so I always explicitly set it (with -server as an argument to the JVM).
- igouy 14y ago>> jruby pidigits.rb 2000 takes 4.132s << Why did you measure a workload 1/5th of the workload shown on the benchmarks game webpages? Each program page shows measurements for 3 workloads, in the case of pi-digits 2,000 6,000 and 10,000. http://shootout.alioth.debian.org/u32/program.php?test=pidigits&lang=jruby&id=3 http://shootout.alioth.debian.org/u32/program.php?test=pidig...
- spitfire 14y agoPossibly not. Those benchmarks (mandelbrot and n-body, pi-digits) are very low memory footprint benchmarks. So it might be a difference of going from 20K to 30meg constant memory usage. Whereas the other benchmarks seem to have single digit multiples of memory usage. SO seemingly real world apps will use more memory, but not 100x in practice.
- nahname 14y agoRuby 1.9.? There is a significant difference between 1.9.1 and 1.9.3
- igouy 14y agohttp://shootout.alioth.debian.org/u32/ruby.php#about http://shootout.alioth.debian.org/u32/ruby.php#about or http://shootout.alioth.debian.org/u32/program.php?test=nbody&lang=yarv&id=2#about http://shootout.alioth.debian.org/u32/program.php?test=nbody... or ...
- bascule 14y agoIf you're confused about what InvokeDynamic is... Previously languages like Ruby suffered on the JVM as the set of JVM instructions available were designed around the Java programming language. This meant that for invoking Ruby methods and other things like accessing instance variables could not take advantage of many of the JVM's features such as method inlining. Since HotSpot is unaware of Ruby semantics, invoking Ruby methods involved a bunch of custom logic implemented in the form of bytecodes which were completely opaque to HotSpot and thus could not be optimized away. InvokeDynamic allows JRuby to teach the JVM how to invoke Ruby methods in a way that plays friendly with the HotSpot inliner. Here's a contrived example of HotSpot inlining a Ruby method and optimizing it down to a single assembly instruction: https://gist.github.com/3728777 https://gist.github.com/3728777
- rockyj 14y agoI will be happy if someone corrects me but JDK 7 has some bugs with InvokedDynamics and it is turned off by default. These bugs have been fixed in JDK 8 (beta so far). In the future, even if JRuby team does only bug fixes, JRuby will get faster and faster as JVM's support for dynamic languages improves through InvokedDynamics.
- igouy 14y agoAnd can be turned on like this: /usr/local/src/jruby-1.7.0/bin/jruby -Xcompile.invokedynamic=true
- mark_l_watson 14y agocool. "rvm install jruby-1.7.0" works :-)
- jamesbritt 14y agoI initially got an "Error: Your application used more stack memory than the safety cap" message running that. This solved it: https://github.com/jruby/jruby/issues/346 https://github.com/jruby/jruby/issues/346 tl;dr: rvm get stable then reinstall jruby 1.7.0
- bascule 14y ago"rvm get head; rvm install jruby" also works ;)
- josephlord 14y agoIs JRuby worth using if JVM language integration isn't needed? E.g. A fairly standard Rails app.
- joevandyk 14y agoI'd use jruby if you were going to use something like http://torquebox.org/ http://torquebox.org/
- awj 14y agoIt's hard to say from the description of "fairly standard". Libraries with C extensions may not work with JRuby. A few Rails deployment options aren't available with JRuby, and the ones that do support it may treat it like a second-class citizen. In short, there's potential downsides that may or may not be relevant to your usage. That said, even if you aren't using the Java ecosystem, the garbage collection, performance, and threading in JRuby may be worth your time. It's all up to what you're actually doing.
- taude 14y agoA lot of companies have operational requirements that make running "a fairly standard rails app" possible in their production environments with managed JVM apps.
- threedaymonk 14y agoMy experience is that if you don't need JRuby (for Java interop or to satisfy pointy-haired strictures), you probably won't see much benefit from choosing it, at least for a Rails app. On one hand, JRuby is technically a much better Ruby than Ruby, and if you want to improve bulk throughput you'll probably benefit. On the other, if bulk throughput were important, Ruby probably wouldn't be your first choice, and there are some downsides. The biggest problem, especially for Rails, is the warm-up cost. Rails's start-up time is already painful, and adding to that hardly improves the test-develop cycle. I've not tested this latest release, but in 1.6.8, running a test suite was multiples slower than C Ruby. Test suites, which run a lot of different code, aren't really representative of real-world workloads, but if you're working on an application it really hurts. You might also have trouble with gems that have compiled extensions. It takes a bit of Gemfile fiddling, but there are alternatives to most of those. For applications other than Rails (which is really a bit of a pathological case), JRuby seems well worth a look. I've never found C Ruby's threading up to the job of making a responsive GUI application, but JRuby might work a lot better with its JVM-backed threads.
- joevandyk 14y agoBiggest things stopping me from using jruby: 1. Incomplete integration with postgresql. The ActiveRecord jdbc adapater doesn't have all the features that the standard pg adapter does. 2. Slow startup / test runs. At one point, loading large amounts of files (like during rails bootup) was much slower on jruby than MRI.
- sheff 14y ago> Incomplete integration with postgresql. I'm planning on using it with postgresql - do you have any links to whats not supported with the JDBC drivers ?
- jonstokes 14y agoI use it with Heroku's pg service via a JDBC driver, and I've never had a problem. Do you have any links? Can you elaborate?
- joevandyk 14y agoArrays, hstore, domains, etc. Not supported by the activerecord-jdbc-postgresql adapter.
- bascule 14y ago> Slow startup / test runs. At one point, loading large amounts of files (like during rails bootup) was much slower on jruby than MRI. You can develop on MRI and deploy on JRuby. Several people, including myself and Square, develop JRuby applications this way, and validate stability across multiple Rubies by doing matrix builds on a CI system. Check out Xavier Shay's talk on the matter: http://www.youtube.com/watch?v=hMpd4CzR1f8&t=16m http://www.youtube.com/watch?v=hMpd4CzR1f8&t=16m I know several people balk at this suggestion and claim development should be as close as possible to production... and do that despite the fact they develop on OS X and deploy on Linux, develop with a case insensitive filesystem and deploy to a case sensitive filesystem, develop in an environment without load and deploy to an environment with load, etc...
- VeejayRampay 14y agoCongratulations to all devs, committers, documentation maintainers, supporters, donators, secret lovers and overall alternative ruby enthusiasts.
- mseepgood 14y agoBest Ruby implementation so far.