From 415553e9485d7ba3ed867033ac9c3315107d3c92 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Sun, 17 May 2009 17:20:55 -0500 Subject: Adding caching of file metadata to the autoloader The cache isn't actually used yet - this just adds all of the plumbing. It was found that stat'ing files that didn't exist could take up to 85% of a run, so this is progress toward getting rid of those stats. Signed-off-by: Luke Kanies --- lib/puppet/util/autoload.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/puppet/util/autoload.rb') diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb index 7c176779a..db06ea934 100644 --- a/lib/puppet/util/autoload.rb +++ b/lib/puppet/util/autoload.rb @@ -3,9 +3,12 @@ require 'puppet/util/cacher' # Autoload paths, either based on names or all at once. class Puppet::Util::Autoload + require 'puppet/util/autoload/file_cache' + include Puppet::Util include Puppet::Util::Warnings include Puppet::Util::Cacher + include Puppet::Util::Autoload::FileCache @autoloaders = {} @loaded = [] @@ -74,7 +77,7 @@ class Puppet::Util::Autoload searchpath.each do |dir| file = File.join(dir, path) - next unless FileTest.exist?(file) + next unless file_exist?(file) begin Kernel.load file, @wrap name = symbolize(name) -- cgit