[MacRuby/MacRuby] f16656: improve a performance in String#delete
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: f166560cd6cb658eb540330319a3d15ec34d25dc https://github.com/MacRuby/MacRuby/commit/f166560cd6cb658eb540330319a3d15ec3... Author: Watson <watson1978@gmail.com> Date: 2012-12-29 (Sat, 29 Dec 2012) Changed paths: M string.c Log Message: ----------- improve a performance in String#delete * before user system total real delete 0.960000 0.010000 0.970000 ( 0.968533) * after user system total real delete 0.200000 0.000000 0.200000 ( 0.185961) Test Code: ---- require 'benchmark' str = "hoge abc" * 100 Benchmark.bm(7) do |x| x.report "delete" do 10000.times do str.delete("abc") end end end
participants (1)
-
GitHub