Permalink
Browse files

Shortened the choose benchmark.

  • Loading branch information...
1 parent 0c0409e commit 24e1f5370ab769831e21268df68e05d261bd31ee @postmodern committed Oct 15, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 benchmarks/choose.rb
View
9 benchmarks/choose.rb
@@ -8,11 +8,12 @@
require 'combinatorics/choose'
Benchmark.bm do |b|
- array = (1..25).to_a
+ n = 20
+ array = (1..n).to_a
- (1..25).each do |n|
- b.report("k=#{n}") do
- array.choose(n) { |s| }
+ (1..n).each do |i|
+ b.report("n=#{n} k=#{i}") do
+ array.choose(i) { |s| }
end
end
end

0 comments on commit 24e1f53

Please sign in to comment.