Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Benchmark: interpolation vs concatenation in Ruby
require 'benchmark'
count = 1000000
Benchmark.benchmark do |bm|"concat") { count.times { 11.to_s + '/' + 12.to_s } }"interp") { count.times { "#{11}/#{12}" } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment