Speed up Array#split when block is passed #12842

Merged
merged 1 commit into from Nov 11, 2013

Conversation

Projects
None yet
3 participants
Contributor

kuldeepaggarwal commented Nov 11, 2013

No description provided.

Owner

guilleiguaran commented Nov 11, 2013

I'm pretty sure yield/block_given? are faster but can you do some benchmarks (in Ruby 2.0) and add it in the commit message to have it as reference (e.g. f660abc) ?

Contributor

kuldeepaggarwal commented Nov 11, 2013

Hi @guilleiguaran , I have already added benchmarks in the commit message with reference to ruby-1.9.3-p448, and will update benchmarks w.r.t. Ruby 2.0

Contributor

kuldeepaggarwal commented Nov 11, 2013

Benchmarks w.r.t. Ruby 2.0

Rehearsal ---------------------------------------
old  10.670000   0.150000  10.820000 ( 10.822651)
new   8.520000   0.050000   8.570000 (  8.571825)
----------------------------- total: 19.390000sec

          user     system      total        real
old  10.620000   0.170000  10.790000 ( 10.790409)
new   8.570000   0.110000   8.680000 (  8.686051),

so should I change commit message with new benchmarks?

Owner

guilleiguaran commented Nov 11, 2013

Yes, let's use 2.0 benchmarks since is the preferred version 😃

Member

senny commented Nov 11, 2013

@kuldeepaggarwal yes please use the benchmarks from 2.0 in the commit message. Also make sure to explicitly specify the version. This will clarify things in the future.

@kuldeepaggarwal kuldeepaggarwal Speed up Array#split
Ruby 2.0.0p247
Rehearsal ---------------------------------------
old  10.670000   0.150000  10.820000 ( 10.822651)
new   8.520000   0.050000   8.570000 (  8.571825)
----------------------------- total: 19.390000sec

          user     system      total        real
old  10.620000   0.170000  10.790000 ( 10.790409)
new   8.570000   0.110000   8.680000 (  8.686051)
4aadd16

@guilleiguaran guilleiguaran added a commit that referenced this pull request Nov 11, 2013

@guilleiguaran guilleiguaran Merge pull request #12842 from kuldeepaggarwal/array_split
Speed up Array#split when block is passed
15ef6be

@guilleiguaran guilleiguaran merged commit 15ef6be into rails:master Nov 11, 2013

Contributor

kuldeepaggarwal commented Nov 11, 2013

@senny @guilleiguaran Benchmarks updated w.r.t. Ruby 2.0.0p247

Owner

guilleiguaran commented Nov 11, 2013

Merged!!! thanks for your contribution!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment