You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Sean Ryan <st...@yahoo.co.uk> on 2005/12/16 12:36:03 UTC

Xalan C++ 1.9.0 poor performance - used with Xerces 2.6.0

Hello,

I am using Xalan C++ 1.9.0 on MCVC6.0 and have fairly poor performance.  I am using the .lib file
that is in the Windows distribution on the Apache site.
I am using Xalan from within a standard Win32 DLL, in a fairly large stand-alone application.

I am using Xerces 2.6.0 to build the XML, and then using Xalan to load the XML from a file, and
compile it before performing the XSL transform.

Performance in DEBUG build is 30mins for a 1.5MB XML.
In RELEASE it is about 10 mins for the same 1.5MB XML file.

Performance in the command line samples (XalanTransform and XalanTransformerCallBack) is much
better (less than 3 mins).  
I used the same code in my DLL - so could it be a memory problem ?

I have tried various approaches:
-checked that key() and other xsl features listed at
http://xml.apache.org/xalan-c/usagepatterns.html are not being used.
-using a callback to write out the data
 (don't think this helps - the performance problem occurs where about 512 bytes of data are
written out, then processing, then at the end a steady write out)
-compiling XML source and XSL stylesheets before performing the transform.

>From the call stack it looks like Xalan is NOT using Xerces.
However, one approach I have not tried is to rebuild Xalan so that it does not depend on Xerces.


So, two questions:
-Any idea how to remove Xalan's dependency on Xerces, and would this improve performance?

-Any idea of Xalan 1_10_0 has better performance ? (I see some memory bug fixes...)


___________
Sean Ryan

Re: Xalan C++ 1.9.0 poor performance - used with Xerces 2.6.0

Posted by David Bertoni <db...@apache.org>.
Sean Ryan wrote:
> Hello,
> 
> I am using Xalan C++ 1.9.0 on MCVC6.0 and have fairly poor performance.  I am using the .lib file
> that is in the Windows distribution on the Apache site.
> I am using Xalan from within a standard Win32 DLL, in a fairly large stand-alone application.
> 
> I am using Xerces 2.6.0 to build the XML, and then using Xalan to load the XML from a file, and
> compile it before performing the XSL transform.
> 

It's hard to say what the problem might be without source code and some 
sample inputs, but given the size of your resulting XML file, it could 
be a memory allocation problem.

> Performance in DEBUG build is 30mins for a 1.5MB XML.
> In RELEASE it is about 10 mins for the same 1.5MB XML file.
> 
> Performance in the command line samples (XalanTransform and XalanTransformerCallBack) is much
> better (less than 3 mins).  
> I used the same code in my DLL - so could it be a memory problem ?

Are you by any chance using a ostrstream or ostringstream instance as to
hold the result of the transformation?

> 
> I have tried various approaches:
> -checked that key() and other xsl features listed at
> http://xml.apache.org/xalan-c/usagepatterns.html are not being used.
> -using a callback to write out the data
>  (don't think this helps - the performance problem occurs where about 512 bytes of data are
> written out, then processing, then at the end a steady write out)
> -compiling XML source and XSL stylesheets before performing the transform.
> 
>>>From the call stack it looks like Xalan is NOT using Xerces.
> However, one approach I have not tried is to rebuild Xalan so that it does not depend on Xerces.

You cannot build Xalan-C without Xerces-C, and I'm not sure why you 
would want to do that.  You indicate the sample programs do not exhibit 
any performance issues, so why do you think Xerces-C is the problem in 
your code?

Please show us some code that shows us how you are invoking Xalan-C.  In 
particular, show us how you are handling the output of the transformation.

Also, please subscribe to, and respond to the mailing list, so I don't 
have to moderate your responses.

Dave