summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-06-09 10:59:30 +0000
committerRémy Coutable <remy@rymai.me>2017-06-09 10:59:30 +0000
commit95138a9c16a2d1905354d0f46381b3822b37863d (patch)
tree83472cc6dd76dde58a4fbc2ce5900f2f4418a75c
parent66aad16d1aaa426237e52ef19385385566f194dc (diff)
parentf331bbefec8a1101ac7f1eaa3d5a5f0afa61bd9e (diff)
downloadgitlab-ce-95138a9c16a2d1905354d0f46381b3822b37863d.tar.gz
Merge branch 'rs-bootsnap' into 'master'
Add Bootsnap to all environments to reduce application startup time Closes #33081 See merge request !12034
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock4
-rw-r--r--config/boot.rb12
3 files changed, 17 insertions, 0 deletions
diff --git a/Gemfile b/Gemfile
index e197f53d9b5..715ce2bc6c2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
gem 'rails', '4.2.8'
gem 'rails-deprecated_sanitizer', '~> 1.0.3'
+gem 'bootsnap', '~> 1.0.0'
# Responders respond_to and respond_with
gem 'responders', '~> 2.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index b5f9c3beca7..d34b84df5e6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -82,6 +82,8 @@ GEM
bindata (2.3.5)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
+ bootsnap (1.0.0)
+ msgpack (~> 1.0)
bootstrap-sass (3.3.6)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
@@ -459,6 +461,7 @@ GEM
minitest (5.7.0)
mmap2 (2.2.6)
mousetrap-rails (1.4.6)
+ msgpack (1.1.0)
multi_json (1.12.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
@@ -888,6 +891,7 @@ DEPENDENCIES
benchmark-ips (~> 2.3.0)
better_errors (~> 2.1.0)
binding_of_caller (~> 0.7.2)
+ bootsnap (~> 1.0.0)
bootstrap-sass (~> 3.3.0)
brakeman (~> 3.6.0)
browser (~> 2.2)
diff --git a/config/boot.rb b/config/boot.rb
index f2830ae3166..17a71148370 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -4,3 +4,15 @@ require 'rubygems'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
+
+# Default Bootsnap configuration from https://github.com/Shopify/bootsnap#usage
+require 'bootsnap'
+Bootsnap.setup(
+ cache_dir: 'tmp/cache',
+ development_mode: ENV['RAILS_ENV'] == 'development',
+ load_path_cache: true,
+ autoload_paths_cache: true,
+ disable_trace: false,
+ compile_cache_iseq: true,
+ compile_cache_yaml: true
+)