document() caching

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

document() caching

Martynas Jusevičius
Hey,

as I understand the documents loaded with document() function are
cached for the duration of the transformation.

Where is this implemented though? In URIResolver or elsewhere?

I have implemented a custom URIResolver and the problem I am observing
is that resolve() is called multiple times with the same URI during
the same transformation. This degrades performance and leads me to the
conclusion that the cache doesn't work.

Am I missing something? How can I check if document() caching is enabled?

Thanks,

Martynas

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: document() caching

Michael Kay
The URIResolver.resolve() method isn't called if the (absolutized) URI is already in the document cache.

What you describe shouldn't be happening, so we need to see some evidence that we can investigate.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 9 Jan 2015, at 22:08, Martynas Jusevičius <[hidden email]> wrote:

> Hey,
>
> as I understand the documents loaded with document() function are
> cached for the duration of the transformation.
>
> Where is this implemented though? In URIResolver or elsewhere?
>
> I have implemented a custom URIResolver and the problem I am observing
> is that resolve() is called multiple times with the same URI during
> the same transformation. This degrades performance and leads me to the
> conclusion that the cache doesn't work.
>
> Am I missing something? How can I check if document() caching is enabled?
>
> Thanks,
>
> Martynas
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: document() caching

Martynas Jusevičius
Is it correct that only StreamSource documents with systemId set get
cached? That is the impression I get from looking at the source of
Controller.registerDocument(). And indeed the cache seems to work
after I started setting systemId.

On Sat, Jan 10, 2015 at 11:07 AM, Michael Kay <[hidden email]> wrote:

> The URIResolver.resolve() method isn't called if the (absolutized) URI is already in the document cache.
>
> What you describe shouldn't be happening, so we need to see some evidence that we can investigate.
>
> Michael Kay
> Saxonica
> [hidden email]
> +44 (0) 118 946 5893
>
>
>
>
> On 9 Jan 2015, at 22:08, Martynas Jusevičius <[hidden email]> wrote:
>
>> Hey,
>>
>> as I understand the documents loaded with document() function are
>> cached for the duration of the transformation.
>>
>> Where is this implemented though? In URIResolver or elsewhere?
>>
>> I have implemented a custom URIResolver and the problem I am observing
>> is that resolve() is called multiple times with the same URI during
>> the same transformation. This degrades performance and leads me to the
>> conclusion that the cache doesn't work.
>>
>> Am I missing something? How can I check if document() caching is enabled?
>>
>> Thanks,
>>
>> Martynas
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming! The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: document() caching

Michael Kay
When you use the document() or doc() function, the returned document should be placed in the cache, indexed by a URI formed from the requested URI (in the arguments to document()), not from the systemId of the Source returned by the URIResolver. The code to look at is DocumetntFn.makeDoc().

However, it you supply a document as the initial source document for the transformation, it will only be added to the document pool if its URI is known.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 10 Jan 2015, at 18:05, Martynas Jusevičius <[hidden email]> wrote:

> Is it correct that only StreamSource documents with systemId set get
> cached? That is the impression I get from looking at the source of
> Controller.registerDocument(). And indeed the cache seems to work
> after I started setting systemId.
>
> On Sat, Jan 10, 2015 at 11:07 AM, Michael Kay <[hidden email]> wrote:
>> The URIResolver.resolve() method isn't called if the (absolutized) URI is already in the document cache.
>>
>> What you describe shouldn't be happening, so we need to see some evidence that we can investigate.
>>
>> Michael Kay
>> Saxonica
>> [hidden email]
>> +44 (0) 118 946 5893
>>
>>
>>
>>
>> On 9 Jan 2015, at 22:08, Martynas Jusevičius <[hidden email]> wrote:
>>
>>> Hey,
>>>
>>> as I understand the documents loaded with document() function are
>>> cached for the duration of the transformation.
>>>
>>> Where is this implemented though? In URIResolver or elsewhere?
>>>
>>> I have implemented a custom URIResolver and the problem I am observing
>>> is that resolve() is called multiple times with the same URI during
>>> the same transformation. This degrades performance and leads me to the
>>> conclusion that the cache doesn't work.
>>>
>>> Am I missing something? How can I check if document() caching is enabled?
>>>
>>> Thanks,
>>>
>>> Martynas
>>>
>>> ------------------------------------------------------------------------------
>>> Dive into the World of Parallel Programming! The Go Parallel Website,
>>> sponsored by Intel and developed in partnership with Slashdot Media, is your
>>> hub for all things parallel software development, from weekly thought
>>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>>> look and join the conversation now. http://goparallel.sourceforge.net
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming! The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help