diff --git a/Gemfile b/Gemfile index 042cef674..e721dad0a 100644 --- a/Gemfile +++ b/Gemfile @@ -43,6 +43,7 @@ gem 'memcache_mock' gem 'memoist' gem 'daemons' gem 'oauth2' +gem 'bootsnap' # needed for looser jpeg header compat gem 'ruby-imagespec', :require => "image_spec", :git => "https://github.com/r888888888/ruby-imagespec.git", :branch => "exif-fixes" diff --git a/Gemfile.lock b/Gemfile.lock index d52bcb5a8..8342266b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -82,6 +82,8 @@ GEM bcrypt (>= 3.1.3) bcrypt-ruby (3.1.5-x64-mingw32) bcrypt (>= 3.1.3) + bootsnap (1.0.0) + msgpack (~> 1.0) buftok (0.2.0) builder (3.2.3) byebug (9.0.6) @@ -201,6 +203,8 @@ GEM minitest (5.10.1) mocha (1.2.1) metaclass (~> 0.0.1) + msgpack (1.1.0) + msgpack (1.1.0-x64-mingw32) multi_json (1.12.1) multi_xml (0.6.0) multipart-post (2.0.0) @@ -385,6 +389,7 @@ DEPENDENCIES aws-sdk (~> 2) bcrypt-ruby bigquery! + bootsnap capistrano (~> 3.4.0) capistrano-deploytags (~> 1.0.0) capistrano-rails diff --git a/config/boot.rb b/config/boot.rb index 6b750f00b..0fe553980 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,14 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' # Set up gems listed in the Gemfile. +require 'bootsnap' +require 'tmpdir' +Bootsnap.setup( + cache_dir: File.join(Dir.tmpdir, 'bootsnap-cache'), # Path to your cache + development_mode: ENV['MY_ENV'] == 'development', + load_path_cache: true, # Should we optimize the LOAD_PATH with a cache? + autoload_paths_cache: true, # Should we optimize ActiveSupport autoloads with cache? + disable_trace: false, # Sets `RubyVM::InstructionSequence.compile_option = { trace_instruction: false }` + compile_cache_iseq: true, # Should compile Ruby code into ISeq cache? + compile_cache_yaml: true # Should compile YAML into a cache? +)