Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return early if one of the arrays is empty #5342

Merged
merged 1 commit into from Oct 3, 2018

Conversation

Projects
None yet
2 participants
@ahorek
Copy link
Contributor

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 ahorek:return_early branch 3 times, most recently from 5449005 to bf30587 Oct 3, 2018

pavel

@ahorek ahorek force-pushed the ahorek:return_early branch from bf30587 to 0e90273 Oct 3, 2018

@kares kares merged commit b607e79 into jruby:master Oct 3, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kares

This comment has been minimized.

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
You can’t perform that action at this time.