From c2f70829d9dc1afcc4bbad4aadb21e5053e1fb71 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 20 May 2017 19:42:27 +0200 Subject: [PATCH] Adds bootsnap. Faster boot time (#3176) --- Gemfile | 1 + Gemfile.lock | 4 ++++ config/boot.rb | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/Gemfile b/Gemfile index 782c0da3c19..abee826d40b 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem 'paperclip', '~> 5.1' gem 'paperclip-av-transcoder', '~> 0.6' gem 'addressable', '~> 2.5' +gem 'bootsnap' gem 'cld3', '~> 3.1' gem 'devise', '~> 4.2' gem 'devise-two-factor', '~> 3.0' diff --git a/Gemfile.lock b/Gemfile.lock index 936c1af6bb9..fd463edf553 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,6 +67,8 @@ GEM rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) + bootsnap (0.2.14) + msgpack (~> 1.0) brakeman (3.6.1) builder (3.2.3) bullet (5.5.1) @@ -235,6 +237,7 @@ GEM mimemagic (0.3.2) mini_portile2 (2.1.0) minitest (5.10.2) + msgpack (1.1.0) multi_json (1.12.1) net-scp (1.2.1) net-ssh (>= 2.6.5) @@ -471,6 +474,7 @@ DEPENDENCIES aws-sdk (~> 2.9) better_errors (~> 2.1) binding_of_caller (~> 0.7) + bootsnap brakeman (~> 3.6) bullet (~> 5.5) bundler-audit (~> 0.5) diff --git a/config/boot.rb b/config/boot.rb index 30f5120df69..703738b7642 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,14 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) require 'bundler/setup' # Set up gems listed in the Gemfile. +require 'bootsnap' + +Bootsnap.setup( + cache_dir: 'tmp/cache', + development_mode: ENV['RAILS_ENV'] == 'development', + load_path_cache: true, + autoload_paths_cache: true, + disable_trace: true, + compile_cache_iseq: false, + compile_cache_yaml: false +)