Sha256: 39456136d5bcf609584da741bcd9905ccf46e43756f72f3fccf2ed6cfab2aeb1

Contents?: true

Size: 378 Bytes

Versions: 4

Compression:

Stored size: 378 Bytes

Contents

#!/usr/bin/env ruby

root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
lib_dir = File.join(root_dir,'lib')
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)

require 'benchmark'
require 'combinatorics/permute'

Benchmark.bm do |b|
  array = (1..10).to_a

  (1..10).each do |n|
    b.report("r=#{n}") do
      array.permute(n) { |s| }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
combinatorics-0.5.0 benchmarks/permute.rb
combinatorics-0.4.4 benchmarks/permute.rb
combinatorics-0.4.3 benchmarks/permute.rb
combinatorics-0.4.1 benchmarks/permute.rb