Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Make Module#name and Symbol#to_s return their internal fstrings #2175
In many codebases, especially Rails apps, these two methods are the source of quite a lot of object allocations.
Returning fstrings for both of these methods could significantly reduce allocations, as well as sligthly reduce retention as it would reduce some duplications.
Also, more and more Ruby APIs are now returning fstrings.
Of course this is not fully backward compatible, it's inevitable that some code in the wild is mutating the strings returned by these methods, but I do believe it's a rare occurence, and easy to fix.