Jira (PUP-8686) Autoloader excessively stats files

8 views
Skip to first unread message

Josh Cooper (JIRA)

unread,
May 1, 2018, 8:48:01 PM5/1/18
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
 
Puppet / Bug PUP-8686
Autoloader excessively stats files
Change By: Josh Cooper
Assignee: Josh Cooper
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
May 1, 2018, 8:48:02 PM5/1/18
to puppe...@googlegroups.com
Josh Cooper created an issue
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2018/05/01 5:47 PM
Priority: Normal Normal
Reporter: Josh Cooper

For each puppet resource type, e.g. file, the autoloader will attempt to load all providers for that type. The autoloader's loadall method will glob each directory in its autoloader search pat looking for files of the form puppet/provider/<type>. In a dev/bundler setup with no module there are about 100 directories to scan due to gems, etc.

The files_to_load method will return a list of relative paths, e.g. puppet/provider/type/file/posix.rb. The autoloader will then call load_file to load the file using it's relative path. The autoloader then searches the entire search space again! So we've got an O^2 thing going on.

The autoloader should preserve the absolute path of the provider it globbed, and try to load that file, instead of searching for it again. Making that change reduced the number of stat64 calls from 1515 to 1146, so 25% less.

Rob Braden (JIRA)

unread,
May 13, 2019, 2:37:04 PM5/13/19
to puppe...@googlegroups.com
Rob Braden assigned an issue to Unassigned
Change By: Rob Braden
Assignee: Josh Cooper

Josh Cooper (Jira)

unread,
May 17, 2023, 2:12:01 PM5/17/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP-5773
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Josh Cooper (Jira)

unread,
May 17, 2023, 2:12:03 PM5/17/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Labels: performance

Josh Cooper (Jira)

unread,
May 17, 2023, 2:12:03 PM5/17/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Coremunity Phoenix
Reply all
Reply to author
Forward
0 new messages