rubygems/rubygems — Issue #227: Try to activate only inactive gems
Author: voxik
Created: 2011-12-09 17:53:08+00:00
State: open

Hello,

Once the required file is not found by gem_original_require, RubyGems are going through all gems and tries to find which gem can contain the requested file. Unfortunately, it also goes through gems, which were already activated. However, for such gems, it makes no sense to look for some files to load, because their load paths are already available and the Ruby's require would be successful in that case. My simple patch [1] is trying to short-circuit the unnecessary search for files, and searches just the yet inactive gems. This patch should improve the RubyGems require performance, although I did not tested it. In theory, the more gems are activated, the faster should the require be.

[1] https://gist.github.com/1452549