Summary | Add caching to autoloader |
Queue | Horde Framework Packages |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | jan (at) horde (dot) org |
Requester | jan (at) horde (dot) org |
Created | 07/29/2011 (5087 days ago) |
Due | |
Updated | 11/14/2011 (4979 days ago) |
Assigned | |
Resolved | 11/14/2011 (4979 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
Add Autoloader_Cache library to cache class maps from the Autoloader
package (
Request #10396).3 files changed, 609 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/351190d0cd4e7ae85690fab2b861b6263cda23d6
and make the package class decorating the original default autoloader.
Admins would have to explicitly install this package to enable
autoloader caching, thus we won't need any configuration to disable
it, and we can make it the admin's job to take care of cache cleaning
if necessary. A small script could help with that.
In Horde, we would check if this package's class file exist, and load
that, otherwise fall back to the default autoloader.
Does anybody see any issues with this approach?
these caching backends are available? (e.g. using
sys_get_temp_dir(), file_get_contents(), and file_put_contents()).
these caching backends are available? (e.g. using sys_get_temp_dir(),
file_get_contents(), and file_put_contents()).
New Attachment: autoloader_cache.patch
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Add caching to autoloader
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Feedback
autoloader is the most expensive operation now. The actual file
loading can be improved by using a bytecode cache. Even more expensive
is the class name to file path mapping though, especially the regular
expressions.
The idea is to store this map directly, i.e. without using Horde_Cache
for obvious reasons, in a cache. Since users interested in speeding up
the file loading are using APC or similar anyway, the autoloader
should use such a bytecode cache for caching the map too, if the
extension supports arbitrary caching.