[macruby-changes] [MacRuby/MacRuby] 3b5596: Performance improvement in StringScanner#rest_size

noreply at github.com noreply at github.com
Sat Oct 15 17:56:55 PDT 2011


  Branch: refs/heads/master
  Home:   https://github.com/MacRuby/MacRuby

  Commit: 3b5596fa39dfc3a571b19a4bb77edb1d99e5b53a
      https://github.com/MacRuby/MacRuby/commit/3b5596fa39dfc3a571b19a4bb77edb1d99e5b53a
  Author: Watson <watson1978 at gmail.com>
  Date:   2011-10-15 (Sat, 15 Oct 2011)

  Changed paths:
    M lib/strscan.rb

  Log Message:
  -----------
  Performance improvement in StringScanner#rest_size

* before
      user     system      total        real
  0.200000   0.010000   0.210000 (  0.211851)

* after
      user     system      total        real
  0.010000   0.000000   0.010000 (  0.004731)

----
require 'benchmark'
require 'strscan'

Benchmark.bm do |x|
  str = "x" * 50000
  s = StringScanner.new(str)
  x.report do
    10000.times do
      s.rest_size
    end
  end

end




More information about the macruby-changes mailing list