forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Gardler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FOR-711) Cache results from the Locationmap
Date Fri, 10 Feb 2006 11:08:56 GMT
    [ http://issues.apache.org/jira/browse/FOR-711?page=comments#action_12365876 ] 

Ross Gardler commented on FOR-711:
----------------------------------

Tim has implemented a basic caching mechanism using the Hash technique in the description.

This improves performance considerably, however, there are problems...

Because there are a whole chain of locationmaps it is impossible for the cache to know track
which lm files have changed and which have not.

We may find some inspiration from the XMLFileModule (which is cacheable, see http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/input/XMLFileModule.html).
In this case we would have to aggregate all LMs together into a single doc and use XPath to
find our match. I think this would actually be faster than iterating over all entries in the
locationmap anyway. We are still left with the problem of knowing when the LM is invalidated,
but if we do the aggregation of the sub-LMs in the sitemap we can rely on Cocoons caching
to manage this for us.

A second approach would be to store the location of the LM when we store the source that matches
a pattern. Then, when we retrieve from the cache we will be able to check the source LM has
not been changed and reload if necessary.

This second approach may be faster since we we will not reload the whole LM when a single
sub-LM has changed, but it reuses less of the core Cocoon code. It would also be easier to
implement. Any comments?

> Cache results from the Locationmap
> ----------------------------------
>
>          Key: FOR-711
>          URL: http://issues.apache.org/jira/browse/FOR-711
>      Project: Forrest
>         Type: Sub-task
>   Components: Locationmap
>     Reporter: Ross Gardler
>     Priority: Critical
>      Fix For: 0.8-dev

>
> Now that we are using the locationmap extensively it is showing up just how innefficient
it is. The problem is that for the majority of requests there are multiple reqeuests to the
locationmap. We can make things much faster (especially on the first page request) by caching
results in the locationmap.
> I think a simple cache will sufice, lets just provide a static hashmap using the hint
as a key and, of course, the location as the value.
> If we test all locationmaps and find no result we should record that tere is no result
in this hashmap. This will also be a good place to throw an exception so that Cocoon can better
report such errors (see FOR-701)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message