From: nobu.nokada@... Date: 2002-03-20T14:09:26+09:00 Subject: Re: Why is Ruby so slow? - Solution Hi, At Wed, 20 Mar 2002 11:01:34 +0900, Christoph wrote: > > 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! > > This depends. If you ``set subtract'' a one million element set from an > other one million element set then the current Array#- implementation > will be unbelievably fast. Yes, current implementation is optimized for bigger arrays, it takes O(N+M) time, but former was O(N*M), where arrays with N and M size. Perhaps, in this case, GC occurred several times per each loops by 1,600,000 items hashes. -- Nobu Nakada