Issue #14994 has been reported by chopraanmol1 (Anmol Chopra).

----------------------------------------
Feature #14994: Enumerator::Lazy#uniq & Enumerator::Lazy#grep_v should use proc chaining
https://bugs.ruby-lang.org/issues/14994

* Author: chopraanmol1 (Anmol Chopra)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Proc chaining for Enumerator::Lazy was introduced in https://bugs.ruby-lang.org/issues/6183 

Proc chaining improved the performance on chained lazy enum for adapted method.

Current implementation of proc chaining can be easily used to methods which either transforming data or filter data(exception: expanding data e.g. flat_map, zip). 

This issue suggest to adapt Enumerator::Lazy#uniq & Enumerator::Lazy#grep_v to utilize proc chaining.

Implementation:

**https://github.com/ruby/ruby/pull/1930**

Benchmark Result:
Trunk:
~~~
Chained grep_v 20%    0.228000   0.000000   0.228000 (  0.227204)
Chained grep_v 50%    0.404000   0.000000   0.404000 (  0.407150)
Chained grep_v 100%   0.684000   0.000000   0.684000 (  0.685375)
Chained uniq 20%      0.280000   0.000000   0.280000 (  0.282605)
Chained uniq 50%      0.468000   0.000000   0.468000 (  0.468440)
Chained uniq 100%     0.784000   0.016000   0.800000 (  0.802920)
~~~
Modified:
~~~
Chained grep_v 20%    0.212000   0.000000   0.212000 (  0.212727)
Chained grep_v 50%    0.304000   0.000000   0.304000 (  0.305567)
Chained grep_v 100%   0.444000   0.000000   0.444000 (  0.442978)
Chained uniq 20%      0.240000   0.000000   0.240000 (  0.239457)
Chained uniq 50%      0.340000   0.000000   0.340000 (  0.341840)
Chained uniq 100%     0.512000   0.016000   0.528000 (  0.530302)
~~~



---Files--------------------------------
bench_enum_lazy_proc_chain.rb (781 Bytes)


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