[Rubygems-developers] faster rubygems.rb loading by way of deferred plugin loads, and other resource usage enhancements
drbrain at segment7.net
Wed Jul 7 17:27:54 EDT 2010
On Jul 7, 2010, at 08:27, James Tucker wrote:
> The main 'cheat' in the branch so far is to move plugin loads into the command manager, but I'm not entirely satisfied with this, and so I'm polling for interest in what features plugin authors actually need / want, and where those can be injected. Most specifically, I want to see if they can be done so more lightly.
> Initially, probably the most commonly used plugin is the gemcutter plugin, which provides commands. At present it deliberately loads the CommandManager, which results in loading in about 37 files and the spec cache into memory whenever rubygems.rb is loaded. The difference in startup performance is significantly over an order of magnitude on common developer systems (with largish numbers of gems installed).
> A solution for command plugins would be to have plugins simply register a list of files that should be loaded when commands are going to be invoked. A continuation of this idea leads to an API something along the lines of:
> Gem.register_plugin(:install, 'some_plugin/gem/installer')
> Gem.register_plugin(:command, 'some_plugin/gem/command')
I like this idea.
> Such that rubygems could contain simple internal hooks to load these on demand, rather than ahead of time, avoiding pre-activation of plugins and the current increased cost of loading rubygems.
More information about the Rubygems-developers