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

Accept symbol as report's argument. #26

Merged
merged 1 commit into from Feb 12, 2015
Merged

Accept symbol as report's argument. #26

merged 1 commit into from Feb 12, 2015

Conversation

JuanitoFatas
Copy link
Contributor

Now we could pass symbol to #report like the following 😊 :

require 'benchmark/ips'

data = [*0..100_000_000]

Benchmark.ips do |x|
  x.report(:find)    { data.find    { |number| number > 77_777_777 } }
  x.report(:bsearch) { data.bsearch { |number| number > 77_777_777 } }
end

Now we could pass symbol to #report too.

require 'benchmark/ips'

data = [*0..100_000_000]

Benchmark.ips do |x|
  x.report(:find)    { data.find    { |number| number > 77_777_777 } }
  x.report(:bsearch) { data.bsearch { |number| number > 77_777_777 } }
end
@jemc
Copy link

jemc commented Feb 11, 2015

👍
Just ran into this and was surprised it didn't work.

evanphx added a commit that referenced this pull request Feb 12, 2015
…rt-parameter

Accept symbol as report's argument.
@evanphx evanphx merged commit 9d9dc68 into evanphx:master Feb 12, 2015
@JuanitoFatas JuanitoFatas deleted the feature/takes-symbol-as-report-parameter branch February 13, 2015 01:39
@JuanitoFatas
Copy link
Contributor Author

🍻

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.

None yet

3 participants