Skip to content

return early if one of the arrays is empty#5342

Merged
kares merged 1 commit intojruby:masterfrom
ahorek:return_early
Oct 3, 2018
Merged

return early if one of the arrays is empty#5342
kares merged 1 commit intojruby:masterfrom
ahorek:return_early

Conversation

@ahorek
Copy link
Contributor

@ahorek ahorek commented Oct 2, 2018

require 'benchmark/ips'
Benchmark.ips do |x|
  x.report('&', "[] & Array.new(200)")
end

before

  &    177.163k (± 5.2%) i/s -    886.145k in   5.015640s

after

  &      2.941M (± 5.4%) i/s -     14.643M in   4.996883s

@ahorek ahorek force-pushed the return_early branch 3 times, most recently from 5449005 to bf30587 Compare October 3, 2018 01:24
@kares kares merged commit b607e79 into jruby:master Oct 3, 2018
@kares
Copy link
Member

kares commented Oct 3, 2018

najs!

@kares kares added this to the JRuby 9.2.1.0 milestone Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants