On Fri, Jan 8, 2010 at 10:41 AM, Roger Pack <rogerdpack2 / gmail.com> wrote:
> Also (@Paul) one option with better GC is jruby [or so I hear--I
> haven't actually had any luck getting jruby to run faster than 1.9, on
> windows, but maybe it's just me].

I'd like to hear about what else isn't running faster for you in
JRuby. It probably could be fixed. At least for your example, JRuby
seems to do pretty well:

~/projects/jruby  time jruby -e "(1..7).each{|n| puts n; a =
['a']*(10**n); a.inspect;}"
1
2
3
4
5
6
7

real	0m5.874s
user	0m6.059s
sys	0m0.354s

~/projects/jruby  time ruby1.9 -e "(1..7).each{|n| puts n; a =
['a']*(10**n); a.inspect;}"
1
2
3
4
5
6
7

real	0m46.667s
user	0m45.472s
sys	0m0.503s

As far as GC goes, if a more realtime (or perhaps less-intrusive) GC
is required, JRuby + concurrent GC from any of the mainstream JVMs
would probably fit the bill. On Hotspot, you'd use jruby
-J-XX:+UseConcMarkSweepGC. I assume JRockit (Oracle) and J9 (IBM) have
something similar.

I believe the above example is using the concurrent GC by default
(Snow Leopard now defaults to Java 6 server with concurrent GC).
Here's GC timing output:

http://gist.github.com/272625

- Charlie