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.4.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.4.0.alpha1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.3.2 benchmark-ips/bm_symbol_to_proc.rb
opal-1.3.1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.3.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.3.0.rc1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.3.0.alpha1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.2.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.2.0.beta1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.1.1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.1.1.rc1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.1.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.1.0.rc1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.0.5 benchmark-ips/bm_symbol_to_proc.rb
opal-1.0.4 benchmark-ips/bm_symbol_to_proc.rb
opal-1.0.3 benchmark-ips/bm_symbol_to_proc.rb
opal-1.0.2 benchmark-ips/bm_symbol_to_proc.rb
opal-1.0.1 benchmark-ips/bm_symbol_to_proc.rb
opal-1.0.0 benchmark-ips/bm_symbol_to_proc.rb
opal-1.0.0.beta1 benchmark-ips/bm_symbol_to_proc.rb