From: Yusuke Endoh Date: 2012-04-04T20:59:19+09:00 Subject: [ruby-core:44125] Re: [ruby-trunk - Bug #6183] Enumerator::Lazy performance issue Hello, 2012/4/4 gregolsen (Innokenty Mikhailov) : > Here's the new patch attached - problem, mentioned by Yusuke Endoh, fixed - now I'm creating a new copy of enumerator on each lazy method call. Okay, the next problem :-) (1..10).lazy.select {|x| false }.map {|x| p x }.to_a should print nothing, but it actually prints 1, 2, ..., 10 with your patch applied. It can be fixed easily, though. I glanced your patch. It will degrade functional modularity in enumerator.c. Currently, it not so big problem because it only implements #map and #select. But I guess implementing other methods, especially, #cycle and #zip, will make some functions (process_element and lazy_iterator_block) complex and hard to maintain. Thus, until you create the final patch, it is hard to say whether we can import your patch or not. -- Yusuke Endoh