From: Miao Jiang Date: 2010-03-25T04:36:11+09:00 Subject: [ruby-core:28954] [Feature #3010] slow require gems in ruby 1.9.1 Feature #3010: slow require gems in ruby 1.9.1 http://redmine.ruby-lang.org/issues/show/3010 Author: Miao Jiang Status: Open, Priority: Normal Category: core, Target version: 1.9.x ruby 1.9.1 version: ruby 1.9.1p420 (2010-02-04 revision 26571) [i686-linux] ruby 1.8.7 version: ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux] ruby 1.9 takes a lot time on require 'gemname' ------ for code: foo.rb puts $:.size require 'rubygems' require 'active_record' puts $:.size run: time foo.rb -- in 1.9.1 it shows 106 110 real 0m0.905s user 0m0.777s sys 0m0.125s in 1.8.7 it shows 9 21 real 0m0.263s user 0m0.188s sys 0m0.060s ------- And I check $: in code start and after load gem. in 1.9.1 ruby load the whole rubygems directory on start. in 1.8.7 ruby only load the nessceary directory for rubygems. Maybe that is the reason. ---------------------------------------- http://redmine.ruby-lang.org