From: Jim Freeze Date: 2002-03-20T06:25:56+09:00 Subject: Re: Why is Ruby so slow? - Solution On Wed, Mar 20, 2002 at 05:26:27AM +0900, Venherm Borchers wrote: > Dear colleagues, > > The solution > ------------ > > Nobu Nakada pointed out that the following line might be causing the > problem, and it indeed does: > > nitms = (@col[j]-['']).nitems > > Here I relied on the 'set difference' that returns an array of only > unique elements which then are counted. I have to warn you: this kind > of set operation is _unbelievably_ slow! > How did you implement @col[j]-[''] to get a speed improvement? -- Jim Freeze atto: 1e-18 = one quintillionth parsec: 3.258 light-years: 3.258 * 186000 * 364 * 24 * 3600 * 5280 * 12 attoparsec: atto * parsec =~ 1.20 inch My height: 62 inches / 1.2 = 51.7 attoparsecs ~