Instead of porting everything to a C extension,
here is the approach we used, step by step :
1
Identify the scenarios we want to optimize. Assign a priority to each of
these scenarios. These scenarios are called 'fast path'.
Done
2
Using the scenarios, identify in the code everything that belongs to the
fast path.
Done
3
Now, we know which part of the code needs some effort and,
maybe more important, which part of the code don't need to be made faster.
Done
4
Once the fast path is clearly identified in the existing
code, we split the code between a front-end (fast) and a back-end (slow).
Done
5
The point, here, is the integration with the various PHP cache systems, in
two steps :
use explicitely the 'user cache'.
integrate with the opcode cache.
Done
6
We now have a better definition of our fast path : a request
is considered as 'fast path' if every needed data is retrieved from the
cache, meaning that the cache system did not have to use the back-end
classes.
Done
7
The first consequence is that the mount process must be entirely running
in the fast path. We implement it so that it uses only cacheable data.
Done
8
We must now decide who will manage the cache. The stream wrapper is a
natural choice here, as it already supports 'real' and 'virtual/command' URIs.
It will have the responsibility to decide whether the requested data can be
retrieved from the cache or from the back-end. In this case, it also has the
responsibility to decide if it is written in the cache or not.
Done
9
Now, the front-end gets its data from the cache and never directly
communicates with the back-end (except when displaying webinfo/built-in
information).
Done
10
Build a PECL extension including the front-end classes and the cache
gateway. The PHK and Automap extensions use persistent memory to
store the mount information. This, combined with an external cache like APC,
allows to handle requests without physically accessing the package file.
Everything is retrieved from memory.
Done
11
integrate PHK with the opcode caches. This is still experimental and, as
it implies a modification in the PHP core, has to be approved by the PHP
core maintainers.
Done - waiting for approval
12
once the opcode caches support the PHK URIs, we don't have to store the
corresponding node data in the user cache. Only their stat cache entries are
stored.
All site content is (C) F. Laupretre (wishlist) - Unauthorized reproduction forbidden without express written permission. Joomla! is Free Software released under the GNU/GPL License. - Original template design: JLM@joomlabox