The Wire · Showcase
RAILS STRIPS REDUNDANT SYMBOL CACHING, BOOTSNAP FIXES YJIT CACHE MISSES
By RepoJournal · Filed · About Rails
Rails eliminated a now-unnecessary symbol-to-string cache layer by leveraging Ruby 3.0's Symbol#name, while bootsnap's latest release stops discarding its entire compile cache when YJIT is toggled.
The Rails team removed `symbol_column_to_string`, a memoization helper added years ago to avoid allocations during `respond_to?` checks on column names [1]. The optimization is obsolete: `columns_hash` already provides O(1) lookups on an interned string hash, and Symbol#name in Ruby 3.0+ yields that string without allocation. This is a clean simplification that cuts unused code without trading away performance [2]. Separately, Rails is eager-loading strict-locals templates at boot time, making them shareable across requests and Ractors [3]. Both changes land on top of ongoing cleanup: unused Active Record internals were pruned [4], and reflection key handling is being unified under a single Enumerable API [5]. Over in GlobalID, a fix ensures `.fetch` works on models with `find` but no `where` method, restoring the documented contract [6]. Bootsnap 1.25.0 arrives with two wins: smarter YAML caching for temporal types and a critical fix for YJIT users [7]. Previously, toggling YJIT via `--yjit` or environment variable invalidated the entire compile cache because the JIT marker changes RUBY_DESCRIPTION, even though serialized bytecode doesn't change. That's fixed now, keeping the cache hot across development sessions.
One email a day. Unsubscribe in one click.
Keep up with Rails in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Upgrade bootsnap to 1.25.0 to stop losing compile cache on YJIT toggle rails/bootsnap [plan]
- → Review Rails changes to symbol column handling in your app if you override respond_to? rails/rails [monitor]
- → If using GlobalID with non-AR models, update and test .fetch behavior rails/globalid [plan]
References
- [1] Remove `symbol_column_to_string` in favor of `columns_hash` + `Symbol#name` rails/rails
- [2] Merge pull request #58415 from kamipo/remove_symbol_column_to_string rails/rails
- [3] Eager load templates ↗ rails/rails
- [4] Merge pull request #58217 from 55728/remove-unused-activerecord-internals rails/rails
- [5] Use `ActiveRecord::Key.for` in remaining `Array(reflection.*_key)` sites ↗ rails/rails
- [6] Locate records from models that find but not where ↗ rails/globalid
- [7] v1.25.0 ↗ rails/bootsnap