Every now and then I get a really slow response from the app I'm building, and looking at the profiler I could see that it was happening somewhere inside the Fuel::init function, so I stuck a load of extra stuff into that method to measure the execution time at various points throughout. Here's the log output...
Warning - 2013-01-10 17:40:23 --> Fuel\Core\Fuel::init - Execution time after getting the cache_dir : 0.0089578628540039
Warning - 2013-01-10 17:40:33 --> Fuel\Core\Fuel::init - Execution time after getting the cache config setting : 10.016606807709
And here's the relevant bit of code...
static::$cache_dir = \Config::get('cache_dir', APPPATH.'cache/');
if (static::$profiling || static::$logslow)
{
\Profiler::mark(__METHOD__.' Execution time after getting the cache_dir : ' . \Profiler::elapsed());
if(\Profiler::elapsed() > static::$slowtime){
logger(\Fuel::L_WARNING, 'Execution time after getting the cache_dir : ' . \Profiler::elapsed(), __METHOD__);
}
}
static::$caching = \Config::get('caching', false);
if (static::$profiling || static::$logslow)
{
\Profiler::mark(__METHOD__.' Execution time after getting the cache config setting ' . \Profiler::elapsed());
if(\Profiler::elapsed() > static::$slowtime){
logger(\Fuel::L_WARNING, 'Execution time after getting the cache config setting ' . \Profiler::elapsed(), __METHOD__);
}
}
Any ideas why it might take 10 seconds to get the cache setting from config? It doesn't seem to make a difference what this cache setting is.
It looks like you're new here. If you want to get involved, click one of these buttons!