You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Speedup applications boot by caching file locations during require calls.
Speed gain depends on your number of gems. Under 100 gems you likely won't see the difference,
but for bigger applications it can save 1 to 3 seconds of boot time per 100 used gems.
Installation
# Gemfilegem'bootscale',require: false
Important
For correctness cache should be updated everytime $LOAD_PATH is modified by calling Bootscale.regenerate.
For Rails apps it means adding an initializer in config/application.rb.
# config/boot.rb (or wherever you have the require of bundler/setup)require'bundler/setup'require'msgpack'require'bootscale/setup'# or require 'bootscale/rails'
Under the hood
Bootscale caches the absolute location of all requirable files on the $LOAD_PATH and
patches require + autoload to use these absolute paths, thereby avoiding having to check all load paths for every require.
Local development: your load time will be very slow when using a local copy for development like gem 'bootscale', path: '~/Code/bootscal', use via git instead.
Thanks to Aaron Patterson for the idea of converting relative paths to absolute paths.
About
Speedup applications boot by caching require calls