Performance test: 1.8.0p2 versus 1.6.8

I’ve already tried that and it crashes! And I have a 1 GB RAM machines :slight_smile: … So, GC is an really an issue!

José A. S. Alegria

···

-----Original Message-----
From: ahoward [mailto:ahoward@fsl.noaa.gov]
Sent: quarta-feira, 23 de Abril de 2003 5:00 PM
To: ruby-talk ML
Subject: Re: Performance test: 1.8.0p2 versus 1.6.8

On Wed, 23 Apr 2003, [iso-8859-1] José Santos Alegria wrote:

Thanks! I did try it and got just a 10% improvement. The 1.6.8 version
is still faster.

  1. Ruby 1.6.8 under Linux (fields=line.split(“;”, -1); n_fields+=fields.length) ==> 57 seconds
  2. Ruby 1.8.0p2 under Linux (fields=line.split(“;”, -1); n_fields+=fields.length) ==> 83 seconds
  3. Ruby 1.6.8 under Linux (fields=line.split(/;/, -1); n_fields+=fields.length) ==> 59 seconds
  4. Ruby 1.8.0p2 under Linux (fields=line.split(/;/, -1); n_fields+=fields.length) ==> 65 seconds
  5. Python 2.2.2 under Linux (fields=line.split(“;”); n_fields+=len(fields)) ==> 54 seconds

So, your suggestion did improve performance but nevertheless 1.8.0p2
is still slower than 1.6.8 and I believe it shouldn’t! Could it be the
result of increased garbage collection on the 1.8.0p2 version? The
file I’m processing is reasonably large: 400MB with 3.5 million lines!
BTW how can I obtain the time spent by Ruby on garbage collection and
the number of times it was executed?

i’m not sure how smart it would be with a file that large, but you could compare the times of your program with one begining with

GC.disable

in order to guestimate the percentage of time actually taken by the GC.

i really don’t know how accurate that would be, but if the difference was significant you should be able to see some difference - either that or GC.disable - doesn’t.

-a

Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ara.t.howard@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================