Sha256: 860ef1d522afe602b0cd4fcad377bd69daf2bb0e6b48cf9f0974d9e147efdc0a

Contents?: true

Size: 382 Bytes

Versions: 168

Compression:

Stored size: 382 Bytes

Contents

require 'rubygems'
require 'tach'

Tach.meter(10_000) do

  tach('merge') do
    default = { :a => 1, :b => 2 }
    override = { :b => 3, :c => 4 }
    override = default.merge(override)
  end

  tach('loop') do
    default = { :a => 1, :b => 2 }
    override = { :b => 3, :c => 4 }
    for key, value in default
      override[key] ||= default[key]
    end
    override
  end

end

Version data entries

168 entries across 166 versions & 6 rubygems

Version Path
excon-0.64.0 benchmarks/merging.rb
excon-0.63.0 benchmarks/merging.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/excon-0.62.0/benchmarks/merging.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/excon-0.62.0/benchmarks/merging.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/excon-0.62.0/benchmarks/merging.rb
excon-0.62.0 benchmarks/merging.rb
excon-0.61.0 benchmarks/merging.rb
excon-0.60.0 benchmarks/merging.rb
excon-0.59.0 benchmarks/merging.rb
excon-0.58.0 benchmarks/merging.rb
excon-0.57.1 benchmarks/merging.rb
excon-0.57.0 benchmarks/merging.rb
excon-0.56.0 benchmarks/merging.rb
excon-0.55.0 benchmarks/merging.rb
excon-0.54.0 benchmarks/merging.rb
excon-0.53.0 benchmarks/merging.rb
excon-0.52.0 benchmarks/merging.rb
excon-0.51.0 benchmarks/merging.rb
excon-0.50.1 benchmarks/merging.rb
excon-0.50.0 benchmarks/merging.rb