[macruby-changes] [MacRuby/MacRuby] 18fdad: Performance improvement in rb_str_get_uchar when s...

noreply at github.com noreply at github.com
Wed Aug 31 01:01:49 PDT 2011


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

  Commit: 18fdad62cf5bbacf8b15543352f48ebabb8c75b6
      https://github.com/MacRuby/MacRuby/commit/18fdad62cf5bbacf8b15543352f48ebabb8c75b6
  Author: Watson <watson1978 at gmail.com>
  Date:   2011-08-31 (Wed, 31 Aug 2011)

  Changed paths:
    M string.c

  Log Message:
  -----------
  Performance improvement in rb_str_get_uchar when string is included only ascii-compatible characters.

* before
      user     system      total        real
  1.570000   0.000000   1.570000 (  1.568804)

* after
      user     system      total        real
  0.660000   0.000000   0.660000 (  0.665421)

----
require 'benchmark'

Benchmark.bm do |x|
  x.report {
    str = "abc" * 100_000
    1000.times do
      str.chop!
    end
  }
end


  Commit: 15fa913443a935a31c9e68f3d91120dd25b11606
      https://github.com/MacRuby/MacRuby/commit/15fa913443a935a31c9e68f3d91120dd25b11606
  Author: Watson <watson1978 at gmail.com>
  Date:   2011-08-31 (Wed, 31 Aug 2011)

  Changed paths:
    M string.c

  Log Message:
  -----------
  Performance improvement in String#chop when string is included only ascii-compatible characters.

* before
      user     system      total        real
  0.660000   0.000000   0.660000 (  0.665421)
* after
      user     system      total        real
  0.000000   0.000000   0.000000 (  0.001805)
----
require 'benchmark'
Benchmark.bm do |x|
  x.report {
    str = "abc" * 100_000
    1000.times do
      str.chop!
    end
  }
end


Compare: https://github.com/MacRuby/MacRuby/compare/a09abe4...15fa913


More information about the macruby-changes mailing list