Socket
Book a DemoInstallSign in
Socket

fastup

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastup

1.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

Fastup

Fastup builds an index from $LOAD_PATH and patches require to use that index to significantly speed up booting up large Rails apps with many dependencies.

When require 'code' is called, Ruby searches each element of $LOAD_PATH, attempting to load code.rb from each directory in $LOAD_PATH. Watching the output of strace while starting a Ruby program reveals a large number of failed attempts to open non-existent files, until the correct path is found. The index built by fastup allows skipping many of these failed attempts.

The speedup is most noticeable in applications with many dependencies. With few dependencies, the overhead of fastup will cause a small slowdown. Test the speedup first, to see if fastup is worth it or not for any particular application.

plot

Usage

fastup/autoapply should be required after bundler/setup and before Bundler.require, or more generally, after $LOAD_PATH has been populated with all dependencies and before most of them have been require'd.

For example in config/boot.rb of a Rails app:

require 'rubygems'

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'fastup/autoapply'

Production Ready?

This has not been used in production.

FAQs

Package last updated on 22 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.