[MacRuby/MacRuby] 4c0df5: Performance improvement in StringScanner. do not u...
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: 4c0df56e43b37dfb8a69fd7dc88a4fd9fd1d506d https://github.com/MacRuby/MacRuby/commit/4c0df56e43b37dfb8a69fd7dc88a4fd9fd... Author: Watson <watson1978@gmail.com> Date: 2011-10-15 (Sat, 15 Oct 2011) Changed paths: M lib/strscan.rb Log Message: ----------- Performance improvement in StringScanner. do not use the values via accessor method. * before user system total real 0.000000 0.000000 0.000000 ( 0.003927) * after user system total real 0.000000 0.000000 0.000000 ( 0.002341) ---- require 'benchmark' require 'strscan' Benchmark.bm do |x| str = "x" * 500000 s = StringScanner.new(str) x.report do 1000.times do s.concat "a" end end end
participants (1)
-
noreply@github.com