Issue #6183 has been updated by Nobuyoshi Nakada.


I rebased the branch (and fixed a bug in the trunk).
Seems 30~40% faster than the current implementation.

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

* 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>