pooling Transformer objects?

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

pooling Transformer objects?

Nowakowski, Mateusz-2

Hi,

 

Recently I’m migrating to latest Camel XSLT version and I saw that they pool of Transformer objects and after transformation they reset it and put the pool.

 

I dig into Saxon’s  TemplatesImpl.newTransformer() and it is not rally clear for me that it makes sense.

 

So do you recommend pooling Transformer objects?

 

--

Regards,

Mateusz Nowakowski

 


------------------------------------------------------------------------------
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: pooling Transformer objects?

Michael Kay
I would recommend reusing the Templates object (which represents a compiled stylesheet) but not the Transformer object. The Templates object is immutable and threadsafe.

You can serially reuse the Transformer object (i.e. start one transformation in the same thread after another has finished). By default it will hold in memory the cache of documents read using the document() function, which may or may not be a good thing, but can lead to gradual increase in memory usage. You can clear this cache using transformer.reset() - but it's simpler to create a new Transformer.

Michael Kay
Saxonica
+44 (0) 118 946 5893




On 3 Apr 2015, at 12:33, Nowakowski, Mateusz <[hidden email]> wrote:

Hi,

 

Recently I’m migrating to latest Camel XSLT version and I saw that they pool of Transformer objects and after transformation they reset it and put the pool.

 

I dig into Saxon’s  TemplatesImpl.newTransformer() and it is not rally clear for me that it makes sense.

 

So do you recommend pooling Transformer objects?

 

--

Regards,

Mateusz Nowakowski

 

------------------------------------------------------------------------------
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: pooling Transformer objects?

Nowakowski, Mateusz-2

Thank you for the confirmation.

 

--

Regards,

Mateusz Nowakowski

 

From: Michael Kay [mailto:[hidden email]]
Sent: 3 kwietnia 2015 18:01
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] pooling Transformer objects?

 

I would recommend reusing the Templates object (which represents a compiled stylesheet) but not the Transformer object. The Templates object is immutable and threadsafe.

 

You can serially reuse the Transformer object (i.e. start one transformation in the same thread after another has finished). By default it will hold in memory the cache of documents read using the document() function, which may or may not be a good thing, but can lead to gradual increase in memory usage. You can clear this cache using transformer.reset() - but it's simpler to create a new Transformer.

 

Michael Kay

Saxonica

+44 (0) 118 946 5893

 

 

 

On 3 Apr 2015, at 12:33, Nowakowski, Mateusz <[hidden email]> wrote:



Hi,

 

Recently I’m migrating to latest Camel XSLT version and I saw that they pool of Transformer objects and after transformation they reset it and put the pool.

 

I dig into Saxon’s  TemplatesImpl.newTransformer() and it is not rally clear for me that it makes sense.

 

So do you recommend pooling Transformer objects?

 

--

Regards,

Mateusz Nowakowski

 

------------------------------------------------------------------------------
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

 


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help