summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/autoload.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-05-17 17:20:55 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-05-20 18:29:04 +1000
commit415553e9485d7ba3ed867033ac9c3315107d3c92 (patch)
treeedec1c8310b21a6564b7b15a226252f29906a604 /lib/puppet/util/autoload.rb
parentd489a2b9e2806beefd41627adf7e20d23b0924d6 (diff)
downloadpuppet-415553e9485d7ba3ed867033ac9c3315107d3c92.tar.gz
puppet-415553e9485d7ba3ed867033ac9c3315107d3c92.tar.xz
puppet-415553e9485d7ba3ed867033ac9c3315107d3c92.zip
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 <luke@madstop.com>
Diffstat (limited to 'lib/puppet/util/autoload.rb')
-rw-r--r--lib/puppet/util/autoload.rb5
1 files changed, 4 insertions, 1 deletions
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)