Issue #6183 has been updated by Franois Bernier.


As of today, Enumerable::Lazy is pretty much still unused because of the performance hit. Is there anything I could do to help getting this in? Is there a paper on that subject I could read about to make improvements?

----------------------------------------
Feature #6183: Enumerator::Lazy performance issue
https://bugs.ruby-lang.org/issues/6183#change-60344

* Author: Innokenty Mikhailov
* Status: Assigned
* Priority: Normal
* Assignee: Nobuyoshi Nakada
----------------------------------------
I benchmarked Enumerator::Lazy and that's what I got:
                 user     system      total        real
Lazy:        0.690000   0.010000   0.700000 (  0.733160)
Normal:      0.160000   0.010000   0.170000 (  0.186695)

It seems like even with 4 chain links and 3000 elements in initial array, Lazy enumerator is almost 4(!) times slower than the normal case.

Instead of performance benefit we've got 4 times performance drawback.

See test file attached.

---Files--------------------------------
lazy_test.rb (428 Bytes)
bench.rb (389 Bytes)
new_bench.rb (957 Bytes)
16.05.2013.diff (23.8 KB)
26_07_2013.diff (24.6 KB)
26_06_2013_2.diff (24.4 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>