Re: jruby vs mri memory management



Lionel Bouton wrote:
I've briefly tried Jruby 1.0 and 1.1RC2 with the latest Sun 1.6 JVM on
Linux 32bit when we benchmarked the Ruby Quiz #157 submissions, but I
was not impressed (I didn't check the memory usage though):

- both threw a NulllException in the Jruby code when running one of the
submissions (you can easily reproduce this by looking for the benchmark
posts in the archives, there was an URL for a page with all the relevant
code), you just had to launch the benchmark to get it. There was no way
of protecting from this as it was out of Ruby's scope (ie a begin rescue
couldn't catch it),
- 1.0 was slower than MRI (between 2x and 3x) and 1.1RC2 slightly faster
(5 to 10%), the code was mainly doing floating point computations.
- Launching the JVM is 10x slower than MRI (unusable for small scripts
designed to return quickly).

There have been more perf improvements since RC2, but we should be more
than 5-10% faster for normal computation. IO and such tend to drag us
down a bit though, since there's necessarily more layers to go through.

JRuby is still on my watch list (ruby-gettext is now pure Ruby so one of
my main obstacle to using it in production was recently removed) but I'm
not sure it is quite here yet (aborting the first program I try with it
with a NullException is not encouraging).

That's very unusual...most scripts run perfectly. If there's an NPE, it
will be fixed by the end of today.

For the small scripts problem with the JVM loading, at some point I've
read that future JVMs would have the ability of acting as resident
interpreters (ie: a JVM is always running in the background and new
instances are simply feeding it the code instead of loading a whole new
JVM). I didn't found any documentation on that in the java man page of
my local Sun 1.6.0.03 JDK install though :-(

JRuby supports running with Nailgun, a memory-resident background JVM.
You need the source release to set it up, since it builds a small client
app written in C. Unpack, "ant jruby-nailgun", and then you can use
jruby-ng-server and jruby-ng to run scripts. There are a few caveats
listed here, but it works pretty nice for quick hits:

http://wiki.jruby.org/wiki/JRuby_with_Nailgun

- Charlie

.



Relevant Pages

  • Re: sparse polynomial arithmetic
    ... Fateman's benchmark, double-precision coefficients (16-bit ... memory usage, then probably the hash table gets resized but the memory ...
    (sci.math.symbolic)
  • Re: "[64-bit] Traffic Jam" by Tom Yager, InfoWorld
    ... Power Mac G5 today) and IBM JVM, you can conclude that on this platform, ... On the AMD64 platform running a Linux-based OS and both Sun and IBM ... necessary to benchmark a specific application in its specific execution ... set of Java applications, but not for the whole range. ...
    (borland.public.delphi.non-technical)
  • Re: Fastcode MM B&V 0.41
    ... > role than the execution order. ... If you leave the system alone, the memory usage scores stays ... Opening up other programs during a benchmark is not ...
    (borland.public.delphi.language.basm)
  • Looking for multithreaded applications for a Benchmark to a disributed JVM
    ... We're writing a distributed shared memory JVM, and we have to create our own ... benchmark utility to demonstrate its performance comparing to other JVMs. ... multithreaded, open source application (like image processing, exhaustive ... key search, etc). ...
    (comp.lang.java.programmer)
  • SciMark benchmark
    ... mailing list that Sun's JVM offers C-like performance whereas .NET only ... commonly-cited SciMark benchmark. ... I noticed that the performance of the Monte Carlo section of the ... benchmark was actually testing the VMs ability to remove unnecessary locks ...
    (microsoft.public.dotnet.languages.csharp)

Loading