[MacRuby/MacRuby] 48f006: improve a performance in String#index(pattern) whe...
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: 48f006a49d5c97009f1b51e06af82e1005a41c32 https://github.com/MacRuby/MacRuby/commit/48f006a49d5c97009f1b51e06af82e1005... Author: Watson <watson1978@gmail.com> Date: 2012-12-28 (Fri, 28 Dec 2012) Changed paths: M string.c Log Message: ----------- improve a performance in String#index(pattern) when passed one character as pattern * before user system total real index 3.190000 0.000000 3.190000 ( 3.195554) * after user system total real index 0.300000 0.000000 0.300000 ( 0.296230) Test Code: ---- require 'benchmark' str = "hoge" * 10000 + "\n" Benchmark.bm(7) do |x| x.report "index" do 10000.times do str.index("\n") end end end
participants (1)
-
GitHub