Skip to content

Commit

Permalink
app: enable Bootsnap
Browse files Browse the repository at this point in the history
Bootsnap speeds up the initial loading of the Rails app by:
- Optimizing the LOAD_PATH dynamically
- Caching the result of Ruby bytecode compilation

Cached data are written to `tmp/cache/bootsnap*`.

This is enabled in the default Rails app template.
  • Loading branch information
kemenaran committed Mar 19, 2021
1 parent 5e7424a commit 56b3601
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ gem 'administrate'
gem 'after_party'
gem 'anchored'
gem 'bcrypt'
gem 'bootsnap', '>= 1.4.4', require: false # Reduces boot times through caching; required in config/boot.rb
gem 'browser'
gem 'chartkick'
gem 'chunky_png'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ GEM
bcrypt (3.1.16)
bindata (2.4.8)
bindex (0.8.1)
bootsnap (1.7.2)
msgpack (~> 1.0)
brakeman (5.0.0)
browser (5.3.0)
builder (3.2.4)
Expand Down Expand Up @@ -419,6 +421,7 @@ GEM
minitest (5.14.4)
momentjs-rails (2.20.1)
railties (>= 3.1)
msgpack (1.4.2)
multi_json (1.15.0)
multipart-post (2.1.1)
mustermann (1.1.1)
Expand Down Expand Up @@ -781,6 +784,7 @@ DEPENDENCIES
annotate
axe-matchers
bcrypt
bootsnap (>= 1.4.4)
brakeman
browser
capybara
Expand Down
3 changes: 2 additions & 1 deletion config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.

0 comments on commit 56b3601

Please sign in to comment.