$ the-wire · showcase
Deprecation proxies get a BasicObject base, URL generation allocates less
By RepoJournal · Filed · About Rails · Composed from the cited sources · methodology
Active Support's deprecation proxies have been leaking core_ext methods onto themselves for two decades' worth of load order, and Akira Matsuda's fix rebases them on BasicObject.
Base the deprecation proxies on BasicObject rails/rails
Akira Matsuda rebased DeprecationProxy on BasicObject, replacing the Ruby 1.8-era trick of undefining every Object instance method at load time. Because Active Support loads its deprecator before any core_ext, every method core_ext later adds to Object (to_json, to_param, to_query, blank?, in?, html_safe?, with_options) has been landing on the proxy rather than being forwarded to the deprecated...
Use a module instance variable for silencer rails/rails
John Hawthorn caught that Rails.logger.silencer = false raised NoMethodError after class_attribute dropped its instance writer, and moved the state to a module instance variable. The old global behavior is preserved and the value stays readable from non-main Ractors.
Reduce allocations when building HTTP URLs rails/rails
URL generation now skips the temporary strings and regexp captures for plain hosts and common UTF-8 HTTP(S) protocols, allocating a host buffer only when the host is actually rewritten. Parser fallbacks remain for embedded schemes and ports, String subclasses, proxies, and custom domain extractors, so the fast path does not change behavior on the odd cases.
Avoid Rational allocations in Time#change when usec is zero rails/rails
Time#change used to build a zero Rational and promote Integer seconds to Rational on every :hour, :min or :sec change without an explicit :usec, which is the path beginning_of_day, beginning_of_hour and change(hour: 0) all take; zero usec now skips the addition entirely.
Only rewrite error attribute names that need it rails/rails
Smaller cleanup in the same frame: ActiveModel::Error.full_message no longer copies its attribute name twice, and generate_message only strips index suffixes for indexed names. Neither rewrite ever changed anything for non-nested, non-indexed attributes, so they now run only where they matter.