So, with about 2 minutes investigation, Devel::NYTProf reveals that this will halve the time of my regression test for a work module:
use Memoize;
memoize 'Config::Any::plugins';
Sadly it won't work out for me whether that's the right thing to do, or whether there's a more correct fix to solve the real underlying problem.
Module::Pluggable (Score:1)
Hah, that's interesting
Yes, AFAIK Module::Pluggable doesn't cache its results, to each time you call ->plugins it will rescan the hierarchy
Usually people only load a config at startup once, so it's not typically a problem
In Config::Any:
{ my (@plugins, $loaded); sub plugins { return @plugins if $loaded; $loaded = 1; return @plugins = $finder->plugins } }
Re: (Score:2)
I am interested in startup times too, and we're using lots of little config files - hence this problem. I guess we're "special". :-)