Bug #4461

Module path should be cached

Added by Markus Roberts over 1 year ago. Updated over 1 year ago.

Status:Closed Start date:08/03/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Affected Puppet version: Branch:http://github.com/jes5199/puppet/tree/ticket/2.6.x/4461
Keywords:
Votes: 0

Description

As Brice writes on #4303:

We’re constantly calling Puppet::Util::Autoload#module_directories, which in turns does a lot of filesystem stuff (File.join, FileTest.directory?), which are slow. With a large module path setting, this can be really worst.

The call chain is the following: either coming from resource evaluation or to_resource

Puppet::Resource#find_resource_type
Puppet::Resource#find_builtin_resource_type
Puppet::MetaType::Manager#type
Puppet::Util::Autoload#load
Puppet::Util::Autoload#searchpath
Puppet::Util::Autoload#search_directories
Puppet::Util::Autoload#module_directories

Caching the module_directories returned list, makes the compilation 30% faster than 0.25.5 :) Unfortunately, as always with caching is to know when to invalidate the cache…

The caching was removed in the patch for #1175, commit:ccc869ea48397235d7ba2a5695424eee4923cb9d because it wasn’t environment sensitive.

To keep things clearer I’m splitting this off as a separate issue; see #4302 of prior context.


Related issues

related to Puppet - Bug #1175: Custom function doesn't work when using multiple environm... Closed
related to Puppet - Bug #4302: compile performance on 2.6 Closed 07/20/2010

History

Updated by Jesse Wolfe over 1 year ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to http://github.com/jes5199/puppet/tree/ticket/2.6.x/4461

Updated by Markus Roberts over 1 year ago

  • Status changed from In Topic Branch Pending Review to Closed

commit:f54d843e4e585274f724c97f1b10288d8798a63b Fix #4461 – attempt to fix another performance issue

Also available in: Atom PDF