PERF: add FORCE_BOOTSNAP env var
Bootsnap is designed to work in production per: https://github.com/Shopify/bootsnap
Over the years we have seen very few issues with it, none of which were corruption.
This allows us to enable bootsnap in production
Having bootsnap enabled means that we can speed up deploys by about 5 seconds per server. It also means a lot less waiting for various production rake tasks and so on.
diff --git a/config/boot.rb b/config/boot.rb index ae2ee5b..affd36c 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -12,7 +12,7 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) -if ENV['RAILS_ENV'] != 'production' && ENV['RAILS_ENV'] != 'profile' +if (ENV['FORCE_BOOTSNAP'] == '1') || (ENV['RAILS_ENV'] != 'production' && ENV['RAILS_ENV'] != 'profile') begin require 'bootsnap' rescue LoadError
GitHub sha: cbaad631