Technology moves fast! ⚡ Don't get left behind.🚶 Subscribe to our mailing list to keep up with latest and greatest in open source projects! 🏆


Subscribe to our mailing list

bootscale

Speedup applications boot by caching require calls

Subscribe to updates I use bootscale


Statistics on bootscale

Number of watchers on Github 188
Number of open issues 3
Average time to close an issue about 8 hours
Main language Ruby
Average time to merge a PR about 6 hours
Open pull requests 0+
Closed pull requests 4+
Last commit over 2 years ago
Repo Created almost 4 years ago
Repo Last Updated over 1 year ago
Size 80 KB
Organization / Authorbyroot
Contributors3
Page Updated
Do you use bootscale? Leave a review!
View open issues (3)
View bootscale activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating bootscale for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Bootscale

Build Status Gem Version

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

# Gemfile
gem '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.

module MyApp
  class Application < Rails::Application
    initializer :regenerate_require_cache, before: :load_environment_config do
      Bootscale.regenerate
    end
  end
end

Rails applications

Locate require 'bundler/setup' in config/boot.rb and add require 'bootscale/rails' after it:

require 'bundler/setup'
require 'bootscale/rails'

Other Bundler enabled applications

Locate require 'bundler/setup', and add require 'bootscale/setup' after it:

require 'bundler/setup'
require 'bootscale/setup'

Faster cache loading

In order to gain ~10-30ms of extra load speed, you can use the msgpack gem:

# Gemfile
gem 'msgpack',   require: false
gem 'bootscale', require: false
# 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.

Problem outlined in this talk

Troubleshooting

If you're experiencing problems with loading your application, especially after moving files around, try deleting the tmp/bootscale folder.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/byroot/bootscale.

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.

bootscale open issues Ask a question     (View All Issues)
  • almost 3 years Any experience on using it with passenger?
  • about 3 years multiple included blocks error
  • over 3 years Integrate RMI 2.3 ISeq serialization
  • almost 4 years Bootscale/activesupport?
bootscale list of languages used
More projects by byroot View all
Other projects in Ruby