From 138f19fc6e7bb1d8ebf305decaa045c53787297c Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Sat, 16 May 2009 00:08:35 -0500 Subject: Caching whether named autoloaded files are missing This is the big win, because it causes us to just skip the whole loading infrastructure, including skipping looking through the modulepath. Signed-off-by: Luke Kanies --- lib/puppet/util/autoload.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/puppet/util/autoload.rb') diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb index db06ea934..fb15adf92 100644 --- a/lib/puppet/util/autoload.rb +++ b/lib/puppet/util/autoload.rb @@ -73,6 +73,8 @@ class Puppet::Util::Autoload # Load a single plugin by name. We use 'load' here so we can reload a # given plugin. def load(name) + return false if named_file_missing?(name) + path = name.to_s + ".rb" searchpath.each do |dir| @@ -92,10 +94,10 @@ class Puppet::Util::Autoload puts detail.backtrace end end - return false + return named_file_is_missing(name) end end - return false + return named_file_is_missing(name) end # Mark the named object as loaded. Note that this supports unqualified -- cgit