6.0.0-git
2021-09-25

[#10396] Add caching to autoloader
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 2011-07-29 (3711 days ago)
Due
Updated 2011-11-14 (3603 days ago)
Assigned
Resolved 2011-11-14 (3603 days ago)
Milestone
Patch No

History
2011-11-14 05:25:13 Jan Schneider Assigned to Jan Schneider
State ⇒ Resolved
 
2011-11-14 05:03:14 Git Commit Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

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
2011-09-16 15:46:13 Jan Schneider Comment #5 Reply to this comment
One solution could be to make this a separate non-dependant package, 
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?
2011-09-06 16:52:43 Jan Schneider Comment #4 Reply to this comment
POC, works pretty well, still needs a way to invalidate the cache.
What about providing a *very* basic temp file fallback if none of 
these caching backends are available?  (e.g. using 
sys_get_temp_dir(), file_get_contents(), and file_put_contents()).
http://git.horde.org/horde-git/-/commit/192c56b7c64ad886b25ae4fb250eb853e310ff01
2011-08-01 20:10:47 Michael Slusarz Comment #3 Reply to this comment
POC, works pretty well, still needs a way to invalidate the cache.
What about providing a *very* basic temp file fallback if none of 
these caching backends are available?  (e.g. using sys_get_temp_dir(), 
file_get_contents(), and file_put_contents()).
2011-07-29 21:52:58 Jan Schneider Comment #2
New Attachment: autoloader_cache.patch Download
Reply to this comment
POC, works pretty well, still needs a way to invalidate the cache.
2011-07-29 16:53:07 Jan Schneider Comment #1
Type ⇒ Bug
State ⇒ Feedback
Priority ⇒ 1. Low
Summary ⇒ Add caching to autoloader
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
For most page requests, loading all the PHP files through the 
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.

Saved Queries