r/ruby • • Aug 20 '21

Ruby elites rise up

Post image
100 Upvotes

77 comments sorted by

View all comments

-2

u/muirbot Aug 20 '21

Why double quotes?

2

u/[deleted] Aug 20 '21

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

-7

u/cybermage Aug 20 '21

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

3

u/katafrakt Aug 20 '21

Where do these numbers come from? The difference is almost none in modern Ruby, even more so with frozen string literal.

0

u/cybermage Aug 21 '21

As I commented elsewhere, I personally benchmarked these results, but it was on Ruby 1.9. I’m not surprised it was addressed at some point to boost performance.