Sha256: 90a229cf320ebae4cbdffe720ac632b8776af1c7ae23f07219e1a9d12f68f11f

Contents?: true

Size: 378 Bytes

Versions: 3

Compression:

Stored size: 378 Bytes

Contents

require 'benchmark'

n = 5_000_000
Benchmark.bmbm do |x|
  x.report('normal string') do
    n.times do
      'hello'
    end
  end
  x.report('monkeypatched string') do
    require 'translate_self'
    n.times do
      'hello'
    end
  end
  x.report('translatable string') do
    require 'translate_self'
    n.times do
      TranslatableString.new('hello')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
translate_self-2.0.1 benchmark.rb
translate_self-1.0.1 benchmark.rb
translate_self-1.0.0 benchmark.rb