From: Kero van Gelder Date: 2002-12-30T21:19:12+09:00 Subject: Re: [1.8] speed > Y> I want to profile the code. Is your test suite the one bundled with > Y> testunit? > > yes. I've seen this big slowdown only with bz2 : libbzip2 internally use > big buffers to decompress the data, with bz2 these buffers are managed by > ruby (ruby_xmalloc). This means that each time I call ::new, the GC is > called. > > This is only how I can explain this slowdown with bz2 Remember the "speed differences" I posted a while ago? Same issue. gc_sweep() got called for each allocation of 100kB, meaning it was ran about 100 times more often for 1.7.3 than for 1.6.8. If I change the allocation size to 100 bytes (instead of 100 kB) 1.7.3 speeds up to match 1.6.8 Suggestion to fix: the GC should not run, unless a threshold on the amount of allocations is crossed. (But my theory on gc is weak, so I am probably missing some things here.) Bye, Kero. +--- Kero ------------------------------ kero@chello.nl ---+ | Don't split your mentality without thinking twice | | Proud like a God -- Guano Apes | +--- M38c ---------- http://httpd.chello.nl/k.vangelder ---+