Skip to content

Commit

Permalink
bench added #clone and #new to String dup
Browse files Browse the repository at this point in the history
  • Loading branch information
burningTyger committed Mar 14, 2011
1 parent 04659a4 commit bfb2acc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions benchmark/core/string/bench_dup.rb
Expand Up @@ -12,4 +12,20 @@
end
end

x.report "clone strings" do |times|
i = 0
while i < times
string.clone
i += 1
end
end

x.report "create new strings" do |times|
i = 0
while i < times
String.new(string)
i += 1
end
end

end

0 comments on commit bfb2acc

Please sign in to comment.