Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Created July 26, 2016 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gr33n7007h/4ccae5ac18f0cb29a6af74e53cfa8957 to your computer and use it in GitHub Desktop.
Save gr33n7007h/4ccae5ac18f0cb29a6af74e53cfa8957 to your computer and use it in GitHub Desktop.
Warming up --------------------------------------
String#+ 39.000 i/100ms
String#concat 37.000 i/100ms
+= 38.000 i/100ms
String#<< 36.000 i/100ms
String#% 10.000 i/100ms
Array#join 13.000 i/100ms
Interpolation 92.000 i/100ms
space 92.000 i/100ms
interpolation space 92.000 i/100ms
Calculating -------------------------------------
String#+ 405.094 (± 1.0%) i/s - 2.028k in 5.006850s
String#concat 379.593 (± 1.1%) i/s - 1.924k in 5.069193s
+= 383.665 (± 0.8%) i/s - 1.938k in 5.051605s
String#<< 372.362 (± 0.5%) i/s - 1.872k in 5.027569s
String#% 100.943 (± 1.0%) i/s - 510.000 in 5.052571s
Array#join 135.165 (± 1.5%) i/s - 676.000 in 5.002483s
Interpolation 923.941 (± 0.6%) i/s - 4.692k in 5.078477s
space 921.247 (± 0.9%) i/s - 4.692k in 5.093493s
interpolation space 929.760 (± 0.6%) i/s - 4.692k in 5.046695s
Comparison:
interpolation space: 929.8 i/s
Interpolation: 923.9 i/s - same-ish: difference falls within error
space: 921.2 i/s - same-ish: difference falls within error
String#+: 405.1 i/s - 2.30x slower
+=: 383.7 i/s - 2.42x slower
String#concat: 379.6 i/s - 2.45x slower
String#<<: 372.4 i/s - 2.50x slower
Array#join: 135.2 i/s - 6.88x slower
String#%: 100.9 i/s - 9.21x slower
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment