Sha256: db240a3ca65fadbdbe82f410d19b1a61251bb03f33f9e12c8a5563ffd28f50a9

Contents?: true

Size: 492 Bytes

Versions: 156

Compression:

Stored size: 492 Bytes

Contents

require 'rubygems'
require 'tach'

data = ["some", "var", "goes", "in", :here, 0]
Tach.meter(1_000_000) do
  tach('for') do
    for element in data
      element == nil
    end
  end
  tach('each') do
    data.each do |element|
      element == nil
    end
  end
end

# ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
# 
# +------+----------+
# | tach | total    |
# +------+----------+
# | for  | 2.958672 |
# +------+----------+
# | each | 2.983550 |
# +------+----------+
# 

Version data entries

156 entries across 154 versions & 6 rubygems

Version Path
excon-0.16.4 benchmarks/for_vs_array_each.rb
excon-0.16.3 benchmarks/for_vs_array_each.rb
excon-0.16.2 benchmarks/for_vs_array_each.rb
excon-0.16.1 benchmarks/for_vs_array_each.rb
excon-0.16.0 benchmarks/for_vs_array_each.rb
excon-0.15.5 benchmarks/for_vs_array_each.rb
excon-0.15.4 benchmarks/for_vs_array_each.rb
excon-0.15.3 benchmarks/for_vs_array_each.rb
excon-0.15.2 benchmarks/for_vs_array_each.rb
excon-0.15.1 benchmarks/for_vs_array_each.rb
excon-0.15.0 benchmarks/for_vs_array_each.rb
excon-0.14.3 benchmarks/for_vs_array_each.rb
excon-0.14.2 benchmarks/for_vs_array_each.rb
excon-0.14.1 benchmarks/for_vs_array_each.rb
excon-0.14.0 benchmarks/for_vs_array_each.rb
ftl-0.2.0 vendor/bundle/gems/excon-0.13.4/benchmarks/for_vs_array_each.rb
excon-0.13.4 benchmarks/for_vs_array_each.rb
excon-0.13.3 benchmarks/for_vs_array_each.rb
excon-0.13.2 benchmarks/for_vs_array_each.rb
excon-0.13.1 benchmarks/for_vs_array_each.rb