[macruby-changes] [MacRuby/MacRuby] 04bad6: Performance improvement in StringScanner#scan

noreply at github.com noreply at github.com
Sat Oct 15 20:53:01 PDT 2011


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

  Commit: 04bad6782966490efe5e060359661d52b703222c
      https://github.com/MacRuby/MacRuby/commit/04bad6782966490efe5e060359661d52b703222c
  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#scan

* before
      user     system      total        real
  0.030000   0.000000   0.030000 (  0.018517)
* after
      user     system      total        real
  0.020000   0.000000   0.020000 (  0.015783)
----
require 'benchmark'
require 'strscan'
Benchmark.bm do |x|
  str = "x" * 500000
  s = StringScanner.new(str)
  x.report do
    s.scan(/./)
  end
end




More information about the macruby-changes mailing list