Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A helper to dramatically speedup the time it takes to run a 'require rubygems'
branch: master

This branch is 2 commits ahead, 67 commits behind rdp:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


A helper to dramatically speedup the time it takes to load rubygems.

i.e. it makes it so that "require 'rubygems'" no longer has to sap valuable time from your life.

Speed difference (windows box, lots of gem):

$ time ruby examples/require_rubygems_normal.rb
real    0m1.109s

$ time ruby examples/require_fast_start.rb
real    0m0.500s

Yea! Finally ruby script startup times that don't spend forever just reloading gem specs every single time...

It acts about the same as gem_prelude (prelude is 1.9 only currently) -- adds the paths of the highest version of each gem into your load path so they're ready to be required.

It is also good for 1.9 makes script startup faster.  To use it with 1.9 do an
$ export RUBYOPTS=-rfaster_rubygems


== installation ==

$ gem install faster_rubygems

== usage ==

require 'faster_rubygems' at the top of your script.


  $ export RUBYOPTS=-rfaster_rubygems

  you can install it to be used by default thus:

  >> require 'rubygems'
  >> require 'faster_rubygems/install' # installs faster_rubygems to be use in place of normal rubygems when you do a "require 'rubygems'"

  # later, to revert back to normal, should you so desire:
  >> require 'rubygems'
  >> require 'faster_rubygems/uninstall'

  If all else fails in this process (it typically works fine), you can reinstall normal rubygems by running setup.rb from within its package.

== More Speed Comparisons ==

For those interested, speed difference example on linux (250 gems):

$ time ruby examples/require_rubygems_normal.rb
ruby examples/require_rubygems_normal.rb  0.57s user 0.05s system 85% cpu 0.726 total

$ time ruby examples/require_fast_start.rb
ruby examples/require_fast_start.rb  0.04s user 0.02s system 46% cpu 0.121 total

Note also that a few non conforming gems require the use of require 'rubygems' no matter what (they're pretty rare, though--you probably won't run into them, and I'm not aware of any).

Related projects:
1.9's gem_prelude.rb

Something went wrong with that request. Please try again.