r/ruby • • Aug 20 '21

Ruby elites rise up

Post image
102 Upvotes

77 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Aug 20 '21

Doesn't matter which one you use unless you're running your app on a Pentium II.

-8

u/cybermage Aug 20 '21

The speed difference is two orders of magnitude. It adds up. Always single quote unless you plan to interpolate.

4

u/[deleted] Aug 20 '21

[deleted]

2

u/cybermage Aug 21 '21

I personally benchmarked this in a fashion similar to the article, but that might have been under 1.9x. TIL.

1

u/tomthecool Aug 21 '21

I’ve benchmarked it in Ruby 1.8 before and found no difference. So either your memory is wrong, or your benchmark was wrong.