Sha256: 457629126b3e0f0713f5df83eec3067b62f0d7ec8c1187f449efe2dffea31330

Contents?: true

Size: 275 Bytes

Versions: 34

Compression:

Stored size: 275 Bytes

Contents

module BmBlockVsYield
  def self._block(&block)
    block.call
  end

  def self._yield
    yield
  end
end

Benchmark.ips do |x|
  x.report('block') do
    BmBlockVsYield._block { 1+1 }
  end

  x.report('yield') do
    BmBlockVsYield._yield { 1+1 }
  end

  x.compare!
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
opal-1.7.4 benchmark-ips/bm_block_vs_yield.rb
opal-1.7.3 benchmark-ips/bm_block_vs_yield.rb
opal-1.7.2 benchmark-ips/bm_block_vs_yield.rb
opal-1.7.1 benchmark-ips/bm_block_vs_yield.rb
opal-1.7.0 benchmark-ips/bm_block_vs_yield.rb
opal-1.7.0.rc1 benchmark-ips/bm_block_vs_yield.rb
opal-1.6.1 benchmark-ips/bm_block_vs_yield.rb
opal-1.6.0 benchmark-ips/bm_block_vs_yield.rb
opal-1.6.0.rc1 benchmark-ips/bm_block_vs_yield.rb
opal-1.6.0.alpha1 benchmark-ips/bm_block_vs_yield.rb
opal-1.5.1 benchmark-ips/bm_block_vs_yield.rb
opal-1.5.0 benchmark-ips/bm_block_vs_yield.rb
opal-1.5.0.rc1 benchmark-ips/bm_block_vs_yield.rb
opal-1.4.1 benchmark-ips/bm_block_vs_yield.rb
opal-1.4.0 benchmark-ips/bm_block_vs_yield.rb
opal-1.4.0.alpha1 benchmark-ips/bm_block_vs_yield.rb
opal-1.3.2 benchmark-ips/bm_block_vs_yield.rb
opal-1.3.1 benchmark-ips/bm_block_vs_yield.rb
opal-1.3.0 benchmark-ips/bm_block_vs_yield.rb
opal-1.3.0.rc1 benchmark-ips/bm_block_vs_yield.rb