[LRUG] REE vs Ruby 1.9.2

Elise Huard lrug at elisehuard.be
Mon Apr 4 04:25:06 PDT 2011


We're using 1.9.2 on current project.  I've heard of (and installed)
following optimization for the garbage collection:
http://metaskills.net/2011/03/09/gc-tune-ruby-1.9.2-with-rvm/
But I have no benchmarks to prove it's significantly better.

The other main performance advantage of REE over MRI ruby is the
implementation of copy on write
(http://en.wikipedia.org/wiki/Copy-on-write) - this allows substantial
savings of memory on forked ruby processes.
The phusion guys (who developed REE) say that the 1.9. MRI ruby no
longer exposes the necessary items to reproduce copy on write, so they
can't easily make a ruby 1.9 enterprise edition.

So far, we have no complaints as to the stability of 1.9.2.

Elise

On 4 April 2011 12:19, Ashley Moran <ashley.moran at patchspace.co.uk> wrote:
>
> On 4 Apr 2011, at 10:19, Andrew Stewart wrote:
>
>> http://www.rubyenterpriseedition.com/
>>
>> I know Ruby 1.9.2 is better than 1.8.7 in many ways, but does it improve memory usage etc to a degree similar to REE?
>
> Hi Andrew
>
> (First post BTW, hi all!)
>
> We had the honour of having YARV developer Koichi Sasada attend ShRUG last year (he was working at Sheffield Hallam Uni for a while) and he gave us a brief demo of the memory improvements. YARV is more efficient at handling large numbers of small objects in some situations.
>
> Compare the memory usage of this on 1.8.7 and 1.9.2:
>
>    1> ~ % irb
>    ruby-1.9.2-p180 :001 > a = []
>     => []
>    ruby-1.9.2-p180 :002 > 10_000_000.times { a << "a" }
>     => 10000000
>
> On my MBP, that uses 630.3MB in 1.8.7 but only 452.0MB in 1.9.2. I haven't tried it in REE though :)
>
> Interestingly, 1.8.7 wins in this case, with 176.0MB to 184.8MB:
>
>    1> ~ % irb
>    ruby-1.9.2-p180 :001 > a = ["a"] * 10_000_000
>
> This surprised us all, but it turns out that contents of the array in this situation is 10 million references to the same "a" object, whereas above it is clearly not.
>
> HTH!
>
> Cheers
> Ash
>
> [1] http://shrug.org/
>
> --
> http://www.patchspace.co.uk/
> http://www.linkedin.com/in/ashleymoran
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>



More information about the Chat mailing list