Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'benchmark'
- bigstring = "bigstring" * 100
- n = 1000000
- Benchmark.bm do |x|
- x.report("<<") { n.times { bigstring.dup << bigstring << bigstring } }
- x.report("+") { n.times { bigstring + bigstring + bigstring } }
- end
Add Comment
Please, Sign In to add comment