Sha256: 8da35455b9d55a6ea42db392b5b948dd2088d571b161d2f8b2954cbe335257bc

Contents?: true

Size: 274 Bytes

Versions: 47

Compression:

Stored size: 274 Bytes

Contents

# https://github.com/opal/opal/issues/1659#issuecomment-298222232

Benchmark.ips do |x|
  a = []

  50.times do |i|
    a << %(#{i}\n)
  end

  x.report('map block') do
    a.map {|it| it.chomp }
  end

  x.report('map symbol') do
    a.map(&:chomp)
  end

  x.compare!
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.8.2 benchmark-ips/bm_symbol_to_proc.rb
opal-1.8.1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.8.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.8.0.beta1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.7.4 benchmark-ips/bm_symbol_to_proc.rb
opal-1.8.0.alpha1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.7.3 benchmark-ips/bm_symbol_to_proc.rb
opal-1.7.2 benchmark-ips/bm_symbol_to_proc.rb
opal-1.7.1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.7.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.7.0.rc1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.6.1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.6.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.6.0.rc1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.6.0.alpha1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.5.1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.5.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.5.0.rc1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.4.1 benchmark-ips/bm_symbol_to_proc.rb