Sha256: 9687d739341377d530e22e95bb4fef2d90f3e653da28b8b2b207bc0d8d76d04b
Contents?: true
Size: 1.89 KB
Versions: 7
Compression:
Stored size: 1.89 KB
Contents
A helper to dramatically speedup the time it takes to load rubygems i.e. "require 'rubygems'" no longer has to sap valuable time from your life. inspired by a request from Yehuda Katz [1] and 1.9's fast gem_prelude. 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 paths. 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. == installation == git clone git://github.com/rdp/faster_rubygems.git ruby faster_rubygems/install.rb # done == usage == require 'frubygems' or require 'rubygemsf' (both do the same thing). If you were really clever I suppose you could figure out how to override the default rubygem behavior to do this, always :) == Speed differences == 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). Note: you don't need this for ruby 1.9, which already preloads via gem_prelude, but it won't hurt to use it in 1.9--it defaults to a no-op, so doesn't hurt. Related projects: http://github.com/fabien/minigems/tree/master 1.9's gem_prelude http://www.ruby-forum.com/topic/191673 Author may be reached via github rogerdpack [1] http://rubyforge.org/tracker/index.php?func=detail&aid=21288&group_id=126&atid=578
Version data entries
7 entries across 7 versions & 1 rubygems