3 ms·
That's interesting. I was told about a ruby project years ago where they gained a measurable performance boost by converting all the strings without interpolat
by Lio 6y ago
That's interesting.
I was told about a ruby project years ago where they gained a measurable performance boost by converting all the strings without interpolation to single quotes.
That's a vague anecdote so should be taken with a pinch of salt. Even if it was once the case VM often improve to fix these edge cases.
So I was just wondering if there was anything more formal to prove this so that I can avoid this preconception I've been carrying around for years based on nothing more than someone's now dated Lightning Talk.
- anamexis 6y agoHere's a good summary by someone on StackOverflow, with links to Ruby source: https://stackoverflow.com/a/1836838/2850811 https://stackoverflow.com/a/1836838/2850811
- Lio 6y agoThanks for the reply. It seems that any cost is small and at parse time rather than runtime. That seems like a good enough reason to always use double " for consistency to me.