When `dirties` was [added][1] as an option to `uncached`,
`{en,dis}able_query_cache!` were changed to use multiple assignment.
However, multiple assignment allocates an array and is not really
necessary for these methods.
[1]: 5d528ba0c8
Surprisingly, this showed up in a production profile as a large
allocator.
Reproduction:
```ruby
require "active_record"
require "memory_profiler"
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
report = MemoryProfiler.report do
10000.times do
ActiveRecord::Base.connection.enable_query_cache!
end
end
report.pretty_print
```
Before:
```
bundle exec ruby eqc.rb | rg "allocated objects by class" -A 10
allocated objects by class
-----------------------------------
10093 Array
1551 String
12 Class
7 Hash
3 File
2 Proc
2 Thread::Backtrace
2 Thread::Backtrace::Location
2 Thread::Mutex
```
After:
```
bundle exec ruby eqc.rb | rg "allocated objects by class" -A 10
allocated objects by class
-----------------------------------
1551 String
93 Array
12 Class
7 Hash
3 File
2 Proc
2 Thread::Backtrace
2 Thread::Backtrace::Location
2 Thread::Mutex
```
Automatically inferring `:inverse_of` is incompatible with records that
do not declare inverse associations.
Revert for the sake of the impending release.
Previously, every call to `namespace_key` would merge the options given
with the Store's default options. This unnecessarily allocates a new
hash when all `namespace_key` needs is the `namespace` option.
This commit removes the allocation by simply checking the default
options after checking that the passed options do not contain a
`namespace` key.
* Less verbose explanation
* Default Dockerfile config takes care of this with dummy key
* This is an common setup to need
* Less verbose
* Explain what default is
* Real is a weak placeholder for a hint at default
* Not needed for most out the box
* Group together with other logging concerns
* Not needed any more
* Be more succinct
* Not needed
* Never made any sense for testing?
* Fix test
* Default was true, so we still need this
* We dont need to turn this off either
* Slightly broader
`.env.erb` files are not generated any more in new Rails apps, so this commit removes them from the ignore files. Kamal 2 now manages secrets with .kamal/secrets, and this file is meant to be safe for git by
default.
A freshly generated Rails project includes a Rubocop linter violation in this line. This edits the file to stick to the listing rules a new Rails project is shipped with by default.
* Prepare deploy.yml for new Kamal 2 options
* Use Kamal 2 secrets instead of .env
* With Kamal 2 being default, and Cloudflare being common, this is the better production default
* Add default far-future expiry for Thruster
* Just while we are waiting for Kamal 2 to drop
* Update for new secrets location
* Latest turbo-rails
* Dont use Redis for Action Cable when we have Solid Cable
* Remote config changed too
* Add a kamal alias for sqlite db console when appropriate
* No longer relevant
Thruster does this now
* No longer relevant either
Thruster territory
* No longer relevant
* Update railties/lib/rails/generators/app_base.rb
Co-authored-by: Jerome Dalbert <jerome.dalbert@gmail.com>
* Proxy branch was merged
* Update railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
Co-authored-by: Hartley McGuire <skipkayhil@gmail.com>
* Use beta1
* Redis only recommended when solid is skipped
* Use the Kamal 2 beta1
* Use Kamal 2 beta2
---------
Co-authored-by: Jerome Dalbert <jerome.dalbert@gmail.com>
Co-authored-by: Hartley McGuire <skipkayhil@gmail.com>
Calling
```ruby
ActionView::DependencyTracker::ERBTracker#add_static_dependency( [] "test/\#{bucket.bucketable_name.pluralize}/status/show" "\"")
```
Will loop indefinitely. Fixes it by parsing only template strings with a trailing template interpolation.
Co-authored-by: Hartley McGuire @skipkayhil