Project

General

Profile

Actions

Feature #6183

closed

Enumerator::Lazy performance issue

Added by gregolsen (Innokenty Mikhailov) over 9 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:43529]

Description

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) lazy_test.rb gregolsen (Innokenty Mikhailov), 03/21/2012 10:24 PM
bench.rb (389 Bytes) bench.rb benchmark used for measuring gregolsen (Innokenty Mikhailov), 04/03/2012 05:43 PM
new_bench.rb (957 Bytes) new_bench.rb gregolsen (Innokenty Mikhailov), 05/16/2012 05:15 PM
16.05.2013.diff (23.8 KB) 16.05.2013.diff gregolsen (Innokenty Mikhailov), 05/17/2013 05:48 AM
26_07_2013.diff (24.6 KB) 26_07_2013.diff gregolsen (Innokenty Mikhailov), 06/26/2013 07:20 PM
26_06_2013_2.diff (24.4 KB) 26_06_2013_2.diff gregolsen (Innokenty Mikhailov), 06/27/2013 05:24 AM

Related issues

Has duplicate Ruby master - Bug #6250: Enumerator::Lazy performance increasedRejected04/03/2012Actions
Actions

Also available in: Atom PDF