[macruby-changes] [MacRuby/MacRuby] 9d1114: eliminate processing when was passed receiver in S...

noreply at github.com noreply at github.com
Sat Jun 4 21:31:27 PDT 2011


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

Commit: 9d1114714b7bfbec5bb0787905d7736db3a812db
    https://github.com/MacRuby/MacRuby/commit/9d1114714b7bfbec5bb0787905d7736db3a812db
Author: Watson <watson1978 at gmail.com>
Date:   2011-06-04 (Sat, 04 Jun 2011)

Changed paths:
  M string.c

Log Message:
-----------
eliminate processing when was passed receiver in String#replace.

- before
      user     system      total        real
  0.250000   0.000000   0.250000 (  0.255896)

- after
      user     system      total        real
  0.200000   0.000000   0.200000 (  0.201582)

----
require 'benchmark'

Benchmark.bm do |x|
  str = "a" * 100
  x.report{
    1_000_000.times do
      str.replace(str)
    end
  }
end




More information about the macruby-changes mailing list