diff --git a/benchmark/core/string/bench_dup.rb b/benchmark/core/string/bench_dup.rb index c20d87b9e4..e5373a9ece 100644 --- a/benchmark/core/string/bench_dup.rb +++ b/benchmark/core/string/bench_dup.rb @@ -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