All Projects → byroot → Bootscale

byroot / Bootscale

Licence: mit
Speedup applications boot by caching require calls

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Bootscale

Rails performance
Monitor performance of you Rails applications
Stars: ✭ 345 (+81.58%)
Mutual labels:  rails, performance
Timeasure
Transparent method-level wrapper for profiling purposes in Ruby
Stars: ✭ 192 (+1.05%)
Mutual labels:  rails, performance
Active record doctor
Identify database issues before they hit production.
Stars: ✭ 865 (+355.26%)
Mutual labels:  rails, performance
Query track
Find time-consuming database queries for ActiveRecord-based Rails Apps
Stars: ✭ 258 (+35.79%)
Mutual labels:  rails, performance
App perf
Open source application performance monitoring tool with emphasis on ease of setup and use. Providing similar functionality like NewRelic/AppNeta/Skylight etc.
Stars: ✭ 353 (+85.79%)
Mutual labels:  rails, performance
Prosopite
🔍 Rails N+1 queries auto-detection with zero false positives / false negatives
Stars: ✭ 555 (+192.11%)
Mutual labels:  rails, performance
Execution time
How fast is your code? See it directly in Rails console.
Stars: ✭ 67 (-64.74%)
Mutual labels:  rails, performance
Myperf4j
High performance Java APM. Powered by ASM. Try it. Test it. If you feel its better, use it.
Stars: ✭ 2,281 (+1100.53%)
Mutual labels:  performance
Pinpoint C Agent
It is an agent written by C++, PHP, python languages. And we hope to support other languages by this agent. Until now, it supports [PHP],[C/C++] and [PYTHON].
Stars: ✭ 188 (-1.05%)
Mutual labels:  performance
Saml idp
Ruby SAML Identity Provider, best used with Rails (though not required)
Stars: ✭ 184 (-3.16%)
Mutual labels:  rails
Configurator
Client-side component of the configurator
Stars: ✭ 184 (-3.16%)
Mutual labels:  boot
Easy Monitor
企业级 Node.js 应用性能监控与线上故障定位解决方案
Stars: ✭ 2,451 (+1190%)
Mutual labels:  performance
Preload Webpack Plugin
Please use https://github.com/vuejs/preload-webpack-plugin instead.
Stars: ✭ 2,174 (+1044.21%)
Mutual labels:  performance
Thin
A very fast & simple Ruby web server
Stars: ✭ 2,170 (+1042.11%)
Mutual labels:  rails
Easybuggy
Too buggy web application
Stars: ✭ 189 (-0.53%)
Mutual labels:  performance
Ooor
Odoo Ruby JSON client. Emulates ActiveRecord enough (as much as Mongoid; Implements ActiveModel) to make Rails development with an Odoo datastore straightforward
Stars: ✭ 184 (-3.16%)
Mutual labels:  rails
Rails Style Guide
📗 Russian Version: A community-driven Rails 3 & 4 & 5 style guide.
Stars: ✭ 189 (-0.53%)
Mutual labels:  rails
Opencl Intercept Layer
Intercept Layer for Debugging and Analyzing OpenCL Applications
Stars: ✭ 189 (-0.53%)
Mutual labels:  performance
Fast Histogram
⚡️ Fast 1D and 2D histogram functions in Python ⚡️
Stars: ✭ 187 (-1.58%)
Mutual labels:  performance
Azuredatabricksbestpractices
Version 1 of Technical Best Practices of Azure Databricks based on real world Customer and Technical SME inputs
Stars: ✭ 186 (-2.11%)
Mutual labels:  performance

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].