ZF-12478: PluginLoader file cache and scalability

Issue Type: Performance Improvement Created: 2012-11-28T18:55:23.000+0000 Last Updated: 2013-04-05T16:07:08.000+0000 Status: Closed Fix version(s): Reporter: Ryan Graciano (rmgraci) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Loader

Related issues: Attachments:


Upon moving to an architecture that is more dependent on helpers than before, we have noticed a substantial decrease in site performance. After doing some benchmarking, enabling the PluginLoaderCache has given us a substantial performance boost (~15%), but we are noticing that it is still inefficient:

  • PluginLoader has no persistent cache across requests mapping name to classname, so it needs to loop through prefixes and check class_exists() on every one, every time, until it finds the helper it needs.
  • The filesystem is hit on every prefix (see ZF-11426), resulting in many disk accesses. This is especially pronounced in larger codebases.
  • The includeFileCache requires that every helper be loaded up front in one big file on every request. This is not scalable for large codebases with many helpers.

We have a couple of potential solutions -

A) Give us an option to auto-load these classes. This could be done by replacing the includeFileCache with a classNameCache which maps $name => $className. Rather than loop through each prefix/name combo with class_exists, and then going to the disk on each one, we could check the name array for $name, return the $className, then allow the auto-loader to manage the class loading.

B) Allow the user to replace PluginLoader entirely with our own logic. I don't think we're the only ones who have a reason to do this:…


Posted by Ralph Schindler (ralph) on 2013-04-05T16:07:08.000+0000

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit:

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.