Project

General

Profile

Bug #4298 » benchmark.rb

Benchmark showing described problem - radarek (Radosław Bułat), 01/20/2011 06:21 PM

 
# encoding: utf-8

require 'benchmark'

s1 = "ąćęłńóśżź!0123456789"

puts Benchmark.measure {
1000.times { s1[1] }
}

s2 = "ąćęłńóśżź!0123456789" * 100_000

puts Benchmark.measure {
1000.times { s2[1] }
}

    (1-1/1)