xsl-list
[Top] [All Lists]

Re: [xsl] Performance tips to speed up multiple transforms

2010-11-05 13:46:37
We had a similar problem. You're right that it's slow because it's restarting the JVM each time; that's probably the most time-consuming part -- whatever happened to that rumored Java CPU that Sun was going to give us? ;-)

You could write a small Java app to do this all at once, but it turns out Saxon has a command line way to do this very efficiently:

   http://www.saxonica.com/documentation/using-xsl/commandline.html

This will take a directory as a source argument, and process all the files in it with the same XSLT file. I think you might have to separately write your secondary output files using the xsl:result-document instruction, rather than just the default standard output to do what you want.

Good luck!

--Rich


Richard Fozzard, Computer Scientist
 Geospatial Metadata at NGDC: http://www.ngdc.noaa.gov/metadata

Cooperative Institute for Research in Environmental Sciences (CIRES)
Univ. Colorado & NOAA National Geophysical Data Center, Enterprise Data Systems 325 S. Broadway, Skaggs 1B-305, Boulder, CO 80305
Office: 303-497-6487, Cell: 303-579-5615, Email: 
richard(_dot_)fozzard(_at_)noaa(_dot_)gov



Neil Owens said the following on 11/05/2010 12:12 PM:
Evening all

I'm transforming around 500 individual XML log files - ~250MB worth - into 4 
output files.  Each log file contributes to all 4 output files.  At present, 
I'm running a Saxon transform within VBScript with one XSLT file for each log 
file.  It processes around 2 log files per second.  I guess it's slow 'cos I'm 
shelling out to a hidden command box every time I transform a log file(open a 
shell, start java, open the Saxon .jar file, run the transform, append the 4 
results to the 4 'master' output files, close everything, repeat ).  It works, 
but I guess it could be significantly more efficient.

What would the smart person be looking at to speed up the process? Write the whole script in Java? .NET? C++... Or just make a Transform 'do' the whole thing?




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--