HomePhorge

Fix #4461 - attempt to fix another performance issue
f54d843e4e58Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fix #4461 - attempt to fix another performance issue

During a profiling of a 2.6.1rc1 puppet master, I found that we
spend a lot of time and efforts in Puppet::Util::Autoload#module_directories.
Since this method is doing a bunch of filesystem access, this process is
slow.

In fact each time we were evaluating a resource or trying to find if a given
resource was a builtin type we ended up scanning the whole module directories
for the given environment.

This patch attempts to fix this performance issue by caching the module_directories
output for the either the time of the compilation or an agent configurer
run (since this stuff looks like to be shared for both compilation and
catalog evaluation).

With this patch, my compilation time for 2k resources went from 5.91s to
3.71s (second run each time to allievate parsing time)..

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>

Edited to fix a typo [#4434]

Signed-off-by: Jesse Wolfe <jes5199@gmail.com>

Details

Provenance
Brice Figureau <brice-puppet@daysofwonder.com>Authored on
markus <markus@AVA-351181.(none)>Committed on Aug 4 2010, 12:19 AM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU2c21faec04f0: Fix for #4300 Solaris svc files need new pid filenames
Branches
Unknown
Tags
Unknown

Event Timeline

markus <markus@AVA-351181.(none)> committed rPUf54d843e4e58: Fix #4461 - attempt to fix another performance issue (authored by Brice Figureau <brice-puppet@daysofwonder.com>).Aug 4 2010, 12:19 AM