Created
August 16, 2012 18:34
-
-
Save jstorimer/3372468 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rehearsal ------------------------------------------------- | |
| string interp 0.200000 0.000000 0.200000 ( 0.202780) | |
| array join 0.520000 0.020000 0.540000 ( 0.540294) | |
| ---------------------------------------- total: 0.740000sec | |
| user system total real | |
| string interp 0.210000 0.000000 0.210000 ( 0.216187) | |
| array join 0.520000 0.000000 0.520000 ( 0.518884) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark' | |
| Benchmark.bmbm do |x| | |
| n = 1_000_000 | |
| subdomain = 'snowdevil' | |
| x.report('string interp') do | |
| n.times do | |
| "#{subdomain}.myshopify.com" | |
| end | |
| end | |
| x.report('array join') do | |
| n.times do | |
| [subdomain, '.myshopify.com'].join | |
| end | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment