You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Cory Isaacson <ci...@compuflex.com> on 2002/10/28 21:11:10 UTC

Resuing a DTM

I have a situation with the following:

A non-changing XML document
A non-changing XSLT doc
Changing XSLT parameters

We need to perform multiple repeated transformations based on the variable
parameters (which cause different sections of the XML to be
processed/filtered based on the values). It takes a lot of memory for each
run right now (300K), as the DTM is being recreated each time. Is there any
way I can cache and re-use this, so that its not rebuilding it?

We have some JSP pages which might call the XSLT 3 or 4 times, so this is
much too large, but with so much of our source being static, I am interested
in any possible optimizations.

Thanks,

Cory

Cory Isaacson
President & CTO
Compuflex International
(818) 884-1168
cisaacson@compuflex.com
www.compuflex.com


Re: Resuing a DTM

Posted by Tom Amiro <To...@Sun.COM>.
Cory,

This sounds like a great application for XSLTC. 
You could cache the XML document and use a templates 
object for the XSLT doc. This may improve performance
as well as conserve on memory.

There some documentation on caching XSLTC's 
specialized DOM. 

http://xml.apache.org/xalan-j/xsltc/xsltc_trax_api.html

This may not have been used much lately, so give it 
a try, and if you have any problems, let us know.

Tom


> Cory Isaacson wrote:
> 
> I have a situation with the following:
> 
> A non-changing XML document
> A non-changing XSLT doc
> Changing XSLT parameters
> 
> We need to perform multiple repeated transformations based on the variable parameters (which cause different sections of the XML to be processed/filtered based on the values). It takes a lot of memory for each run right now (300K), as the DTM is being recreated each time. Is there any way I can cache and re-use this, so that its not rebuilding it?
> 
> We have some JSP pages which might call the XSLT 3 or 4 times, so this is much too large, but with so much of our source being static, I am interested in any possible optimizations.
> 
> Thanks,
> 
> Cory
> 
> Cory Isaacson
> President & CTO
> Compuflex International
> (818) 884-1168
> cisaacson@compuflex.com
> www.compuflex.com
> 

-- 
 Tom Amiro -- SQA Engineer
 Sun XML Technology Development
 voice: 781-442-0589 Fax: 781-442-1437
 eMail: tom.amiro@.sun.com

RE: Resuing a DTM

Posted by Cory Isaacson <ci...@compuflex.com>.
One other point on this. We are already caching the transformer, so we're
looking for an additional way to optimize it.

Thanks,

Cory
  -----Original Message-----
  From: Cory Isaacson [mailto:cisaacson@compuflex.com]
  Sent: Monday, October 28, 2002 12:11 PM
  To: xalan-dev@xml. apache. org
  Subject: Resuing a DTM


  I have a situation with the following:

  A non-changing XML document
  A non-changing XSLT doc
  Changing XSLT parameters

  We need to perform multiple repeated transformations based on the variable
parameters (which cause different sections of the XML to be
processed/filtered based on the values). It takes a lot of memory for each
run right now (300K), as the DTM is being recreated each time. Is there any
way I can cache and re-use this, so that its not rebuilding it?

  We have some JSP pages which might call the XSLT 3 or 4 times, so this is
much too large, but with so much of our source being static, I am interested
in any possible optimizations.

  Thanks,

  Cory

  Cory Isaacson
  President & CTO
  Compuflex International
  (818) 884-1168
  cisaacson@compuflex.com
  www.compuflex.com