Hi,

On Thu, 4 Nov 2004 21:28:45 +0900, Florian Gross <flgr / ccan.de> wrote:
> Sean Russell wrote:
> 
> > I was playing around with the SyncEnumerator from Ruby 1.8, and
> > noticed that it was taking a long time to iterate over elements.
> >
> > The current implementation may be the "correct", or elegant, way to
> > implement it, but it is terribly inefficient.  I rewrote the class,
> > and got the following results:
> >
> > Construction
> > Old: 0.159291
> > New: 0.000352
> > Starting SyncEnumerator
> > ................................................................................
> > 26 shold be 26 :: Time: 19.686455
> > Starting SyncEnumerator_
> > ................................................................................
> > 26 shold be 26 :: Time: 0.028817
> >
> > The new version is nearly three orders of magnitude faster for
> > construction, and is three orders of magnitude faster in execution.
> >
> > Is there any reason why I shouldn't submit this as an RCR to replace
> > SyncEnumerator?
> 
> I wonder how an implementation using .zip with a block would compare? Or
> would that not do the same thing?

Hmm... I don't have the OP's message in my archives...
Assuming it's a transparent change, improving performance without
breaking code, why not just submit it to ruby-core? People are always
posting bug patches there, I suspect that a performance patch wouldn't
be unwelcome.

cheers,
Mark