What is the best way to generate a long string quickly in ruby? This works, but is very slow:
str = \"\"
length = 100000
(1..length).each {|i| str += \"0\"}
        Another relatively quick option is
str = '%0999999d' % 0
Though benchmarking
require 'benchmark'
Benchmark.bm(9)  do |x|
  x.report('format  :') { '%099999999d' % 0 }
  x.report('multiply:') { '0' * 99999999 }
end
Shows that multiplication is still faster
               user     system      total        real
format  :  0.300000   0.080000   0.380000 (  0.405345)
multiply:  0.080000   0.080000   0.160000 (  0.172504)
str = "0" * 999999