[Rubygems-developers] I've replaced LoadPathManager; good performance results

Gavin Sinclair gsinclair at soyabean.com.au
Sat Dec 11 20:08:58 EST 2004

On Sunday, December 12, 2004, 4:58:18 AM, Mauricio wrote:

> On Sun, Dec 12, 2004 at 03:13:55AM +1100, Gavin Sinclair wrote:
>>                                          old        new        old        new
>>   LIBRARY                 |  DIRECT  |   GEM    |   GEM    |  COMBO   |  COMBO
>> ------------------------+----------+----------+----------+----------+----------
>>   'rake'                  |  0.203s  |  3.772s  |  0.757s  |  0.481s  |  0.426s
>>   'redcloth'              |  0.477s  |  0.577s  |  0.089s  |  1.355s  |  0.433s
>>   'log4r'                 |  0.430s  |  0.908s  |  0.767s  |  2.545s  |  0.476s
>>   'extensions/all'        |  0.536s  |  5.594s  |  0.795s  |  2.741s  |  0.643s
>>   'dev-utils/debug'       |  0.640s  |  5.697s  |  1.879s  |  2.056s  |  0.820s
>>   'celsoft.com/template'  |  0.075s  |  0.362s  |  0.174s  |  0.096s  |  0.019s
> [...]
>> However, there's a significant improvement in speed more or less
>> across the board.  I'll be running all the speed tests again, instead
>> of collating data taken from a 12-hour period, but the results gave me
>> confidence enough to commit the code.

> Could you also provide the following info?
> * number of installed packages (whole list if possible)

  20 packages (listed at end of email)

> * value of $: after requiring the lib

  Again, at end of email.

> I believe they could prove fairly useful, especially the former.

> Regarding your methodology, are all these values obtained in the same
> conditions regarding FS caching? Is the  require 'rubygems'  overhead
> included in the above figures or accounted separately?

See test script (rgperf.rb) below.  You should be able to run this
against the latest CVS.  Of course, you have to install/uninstall the
gems/rpas as appropriate.  And for some tests, you don't want "require
'rubygems'" in the script.

All libraries are loaded in a single test.  For me, the time taken to
load 'rubygems' is currently 0.417s.  The first time you search for a
gem (require 'rake' in this case) pays a penalty as that's when the
source index is built up.

I'm not sure how to answer your specific questions, though.


** rgperf.rb:

  $:.unshift 'lib'

  require 'rubygems/timer'

  time("require 'rubygems'")              { require 'rubygems' }

  time("require 'logger'")                { require 'logger' }

  time("require 'rake'")                  { require 'rake' }
  time("require 'redcloth'")              { require 'redcloth' }
  time("require 'log4r'")                 { require 'log4r' }
  time("require 'extensions/all'")        { require 'extensions/all' }
  time("require 'dev-utils/debug'")       { require 'dev-utils/debug' }
  time("require 'celsoft.com/template'")  { require 'celsoft.com/template' }

  puts $LOAD_PATH

** Packages installed:

RedCloth-2.0.11     cstemplate-0.5.1  extensions-0.5.0  rails-0.8.0  rubygems-update-0.8.3
actionmailer-0.3.0  dev-utils-1.0     extensions-0.6.0  rake-0.4.10  sources-0.0.1
actionpack-0.9.0    dev-utils-1.0.1   lafcadio-0.5.2    rake-0.4.4   sqlite-ruby-2.2.1
activerecord-1.0.0  extensions-0.4.0  log4r-1.0.5       rake-0.4.8   vim-ruby-2004.09.20

** $LOAD_PATH after test is complete:


More information about the Rubygems-developers mailing list