1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark/bm_vm2_dstr.rb
ko1 5e2625eebd * benchmark/bm_vm2_dstr.rb: add a benchmark to measure
performance of dynamic generated string ("foo#{bar}baz").



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 23:47:51 +00:00

6 lines
96 B
Ruby

i = 0
x = y = 'z'
while i<6_000_000 # benchmark loop 2
i += 1
str = "foo#{x}bar#{y}baz"
end