From: Eric Crampton Date: 2000-12-16T07:40:01+09:00 Subject: [ruby-talk:7358] Re: Ruby performance question Dave Thomas writes: > Eric Crampton writes: > > > Running on a small dataset of 13 MB of data (around 81000 lines), the > > program takes about 27 seconds on my Linux machine. An equivalent Perl > > code to do the same thing runs in about 10 seconds. > > What happens if you disable garbage collection before you start, and > re-enable it after you read in the whole file? It could be that with > the large number of objects you're creating the GC scan could be quite > expensive. I'm (generally) reading more data than could fit in physical memory, so that's not really an option. Incidently, I tried disabling GC and running it on my small dataset (13 MB) which I would think would fit in physical memory. Somehow, the way Ruby is organizing data in memory causes it to store far, far, far more than 13 MB. I ran out of physical memory (1 GB of RAM) and it went into swap. :-( -- "A truly lazy person will work very hard to not have to work later." --Larry Wall