[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Writing to file vs. storing in a variable

Subject: Writing to file vs. storing in a variable
From: mjyoungblut@xxxxxxx
Date: Fri, 19 Oct 2001 15:42:23 -0500
 Writing to file vs. storing in a variable
I have been an XSL file that compares two files.
There are three main steps:
     1. Compare the two files and store the results in a variable
     2. Use the variable to create a header in output File A
     3. Write the contents of the variable to output File A

I have been using large XML files for the comparison, and the memory
consumption is pretty large.  It is manageable, but if a couple are running
at the same time, running out of memory is definitely a possibility.  It
finally dawned upon me(I am a little slow) that I could break the XSL file
up into three parts:
     1. Compare the two files, writing the results immediately to File A
     2. Read up File A(much smaller than the originals), writing the header
to File B
     3. Copy the contents of  File A to File B

This approach cut down on memory consumption quite a bit.

The problem is that the first part of the second approach takes about 50%
LONGER than all of the steps in the first approach.  I have tried using
Saxon and Xalan, and they are pretty equivalent(other than Xalan being a
big memory hog).

Can anybody explain to me why this would be the case?

Thank you,
     Matt Youngblut

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.