[macruby-changes] [MacRuby/MacRuby] 1b7bd9: refactor

GitHub noreply at github.com
Wed Jun 19 21:00:40 PDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/MacRuby/MacRuby
  Commit: 1b7bd9a8453f2053231c2d9b9d212a169649cccd
      https://github.com/MacRuby/MacRuby/commit/1b7bd9a8453f2053231c2d9b9d212a169649cccd
  Author: Watson <watson1978 at gmail.com>
  Date:   2013-06-19 (Wed, 19 Jun 2013)

  Changed paths:
    M re.c
    M re.h
    M string.c

  Log Message:
  -----------
  refactor


  Commit: cd0c7b7a83cf138773f86315594b97582efdbf82
      https://github.com/MacRuby/MacRuby/commit/cd0c7b7a83cf138773f86315594b97582efdbf82
  Author: Watson <watson1978 at gmail.com>
  Date:   2013-06-19 (Wed, 19 Jun 2013)

  Changed paths:
    M re.h

  Log Message:
  -----------
  loop unrolling to improve the Objective-C methods performance in String object

* before
      user     system      total        real
  2.310000   0.320000   2.630000 (  3.078306)

* after
      user     system      total        real
  1.560000   0.230000   1.790000 (  2.309584)

Test Code:
----
framework 'Foundation'
require 'benchmark'

Benchmark.bm do |x|
  str = "abc" * 100000000
  x.report do
    str.writeToFile("test.txt", atomically:true, encoding:NSUTF8StringEncoding, error:nil)
  end
end


Compare: https://github.com/MacRuby/MacRuby/compare/729bf7893527...cd0c7b7a83cf


More information about the macruby-changes mailing list