Project

General

Profile

Feature #12275 » benchmark.rb

tad (Tadashi Saito), 11/27/2017 07:55 PM

 
require 'benchmark'

N = 1000_000
s = 'あいうえお'.dump

Benchmark.bm do |bm|
bm.report('eval ') do
N.times{eval(s)}
end

bm.report('undump') do
N.times{s.undump}
end
end
(1-1/5)