add bootsnap to speed up test and dev
This commit is contained in:
parent
1019bbda46
commit
704101253d
2
Gemfile
2
Gemfile
|
@ -3,7 +3,7 @@ source 'https://rubygems.org'
|
||||||
#source 'http://production.cf.rubygems.org'
|
#source 'http://production.cf.rubygems.org'
|
||||||
|
|
||||||
# does not install in linux ATM, so hack this for now
|
# does not install in linux ATM, so hack this for now
|
||||||
# gem 'bootsnap', require: false
|
gem 'bootsnap', require: false
|
||||||
|
|
||||||
def rails_master?
|
def rails_master?
|
||||||
ENV["RAILS_MASTER"] == '1'
|
ENV["RAILS_MASTER"] == '1'
|
||||||
|
|
|
@ -62,6 +62,8 @@ GEM
|
||||||
rack (>= 0.9.0)
|
rack (>= 0.9.0)
|
||||||
binding_of_caller (0.7.2)
|
binding_of_caller (0.7.2)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
|
bootsnap (0.2.13)
|
||||||
|
msgpack (~> 1.0)
|
||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
bullet (5.4.2)
|
bullet (5.4.2)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
@ -398,6 +400,7 @@ DEPENDENCIES
|
||||||
barber
|
barber
|
||||||
better_errors
|
better_errors
|
||||||
binding_of_caller
|
binding_of_caller
|
||||||
|
bootsnap
|
||||||
bullet
|
bullet
|
||||||
byebug
|
byebug
|
||||||
certified
|
certified
|
||||||
|
|
|
@ -10,15 +10,18 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||||
|
|
||||||
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
||||||
|
|
||||||
if false && ENV['BOOTSNAP'] #&& ENV['RAILS_ENV'] != 'production'
|
|
||||||
|
if ENV['RAILS_ENV'] != 'production'
|
||||||
|
is_mac = !!(RUBY_PLATFORM =~ /darwin/)
|
||||||
|
|
||||||
require 'bootsnap'
|
require 'bootsnap'
|
||||||
|
|
||||||
Bootsnap.setup(
|
Bootsnap.setup(
|
||||||
cache_dir: 'tmp/cache', # Path to your cache
|
cache_dir: 'tmp/cache', # Path to your cache
|
||||||
development_mode: ENV['BOOTSNAP_DEV'] == 'development',
|
|
||||||
load_path_cache: true, # Should we optimize the LOAD_PATH with a cache?
|
load_path_cache: true, # Should we optimize the LOAD_PATH with a cache?
|
||||||
autoload_paths_cache: true, # Should we optimize ActiveSupport autoloads with cache?
|
autoload_paths_cache: true, # Should we optimize ActiveSupport autoloads with cache?
|
||||||
disable_trace: false, # Sets `RubyVM::InstructionSequence.compile_option = { trace_instruction: false }`
|
disable_trace: false, # Sets `RubyVM::InstructionSequence.compile_option = { trace_instruction: false }`
|
||||||
compile_cache_iseq: true, # Should compile Ruby code into ISeq cache?
|
compile_cache_iseq: is_mac, # Should compile Ruby code into ISeq cache?
|
||||||
compile_cache_yaml: true # Should compile YAML into a cache?
|
compile_cache_yaml: is_mac # Should compile YAML into a cache?
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue