From: "jhawthorn (John Hawthorn) via ruby-core" Date: 2024-11-06T22:03:56+00:00 Subject: [ruby-core:119784] [Ruby master Feature#20350] Return chilled string from Symbol#to_s Issue #20350 has been updated by jhawthorn (John Hawthorn). File Screenshot 2024-11-06 at 14.00.47.png added As one data point in favour of this we swapped Symbol#to_s for Symbol#name (`Symbol.alias_method :to_s, :name`) to GitHub.com last week and it reduced allocations by about 5% on our web requests. So there should be pretty significant savings to users if we can make this default. ![](Screenshot%202024-11-06%20at%2014.00.47.png) ---------------------------------------- Feature #20350: Return chilled string from Symbol#to_s https://bugs.ruby-lang.org/issues/20350#change-110454 * Author: Dan0042 (Daniel DeLorme) * Status: Open ---------------------------------------- During Ruby 2.7 development there was an attempt to return a frozen string from Symbol#to_s (#16150#note-22) This had to be rolled back due to incompatibility, but now we have chilled strings (#20205) Symbol#to_s can safely return a chilled string, giving developers time to fix warnings before switching to a frozen string. ---Files-------------------------------- Screenshot 2024-11-06 at 14.00.47.png (118 KB) -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/