README in faster_rubygems-0.12.2 vs README in faster_rubygems-0.12.5

- old
+ new

@@ -1,42 +1,63 @@ = Faster Rubygems = -A helper gem to dramatically speedup the time it takes to startup a ruby script. -i.e. it makes it so that requiring rubygems no longer takes as long. + +This gem makes loading rubygems *much* faster. + +What it does is cache the location of files in your gem dirs, ex: + +/lib/ruby/gems/1.8/jruby/{active_support, active_record} + +it creates this file: + +/lib/ruby/gems/1.8/jruby/.faster_rubygems_cache + +Then it uses *that* instead of loading full blown rubygems. + + +Timing (on doze with ~ 50 gems installed): + +no rubygems at all: + +$ jruby -e 1 +0.68s. + +require 'rubygems' time: + +$ jruby -rubygems -e 1 + +2.36s normal rubygems: -> 0.94s with faster_rubygems + +time to do a rake -V (get rake version): + +$ jruby -S rake -V + +2.48s with normal rubygems: -> 1.50s with faster_rubygems + +(rake installed into site_ruby and loaded without rubygems takes 1.41s). + +Thus we see that loading of rubygems has decreased from 1.4s to between 0.1s and 0.3s -Speed difference (a demo gem script, ruby 1.8 windows mingw): +with mingw (windows). + + normal rubygems: $ timer ruby whichr 0.83s with faster_rubygems: $ timer ruby whichr 0.19s -Yea! -It acts like a beefed up version of gem_prelude (prelude is 1.9 only currently), with a bit more cacheing thrown in there. - -It makes even more of a difference when used with 1.9 on windows: - -normal rubygems: - - $ timer ruby whichr - 3.8s - -with faster_rubygems: - - $ timer ruby whichr - 0.24s - == installation == -$ gem install faster_rubygems +$ gem install faster_rubygems # installs faster_rubygems into your site lib, overrides normal rubygems now there is a manual step that must be followed: 1.9 @@ -61,22 +82,19 @@ See http://github.com/rdp/faster_rubygems/blob/master/benchmarks.txt for a full breakdown and more benchmarks. == Trouble Shooting == # if you wish to revert back to normal rubygems, do the following: ->> require 'rubygems' ->> require 'faster_rubygems/unoverride' +$ faster_rubygems --unoverride If all else fails in this process (it has typically worked fine), you can reinstall normal rubygems by downloading its package (.tgz) and running ruby setup.rb within it. - To regenerate cache files (should never really be necessary, but if you for some reason think yours are stale) do the following: ->> require 'rubygems' ->> require 'faster_rubygems/create_cache_for_all' +$ faster_rubygems # by default it recaches what it can -Most of the credit for this gem goes to gem prelude. +Most of the credit for this gem goes to gem prelude and some ideas by Charles Nutter. == Related projects == rubygems (of course) http://github.com/fabien/minigems/tree/master \ No newline at end of file