symfony project development at the moment focuses on finding and eliminating more performance issues, as this was high on the whish list. The symfony blog has two postings about recent enhancements.

While being at it i noticed a common 5ms and highly disc bound delay that is included in every call.

It is sfProjectConfiguration#getAllPluginPaths() which returns an array of all plugins and their respective location on the file system. Its basically a sfFinder call that scans a few directories. But that costs. And it is done on every call. But usually the plugins do not change while a site is live, do they?

Here my inofficial enhancement of this. You can easily use this. Just put it into your config/ProjectConfiguration.class.php and you are done:

  public function getAllPluginPaths(){
    $cacheFile = sfConfig::get('sf_cache_dir').'/all_plugin_paths.cache';
    if (is_readable($cacheFile))
    {
      return unserialize(file_get_contents($cacheFile));
    }
 
    $allPluginpaths = parent::getAllPluginPaths();
    file_put_contents($cacheFile, serialize($allPluginpaths));
    return $allPluginpaths;
  }