You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Holger Floerke <fl...@doctronic.de> on 2003/01/07 08:16:03 UTC

Xalan-C: Faster First Time Transforming?

Dear all,

   if I use XalanTransformer (Xalan-C 1.3, Win32, W2K) to transform a 
document (about 800k), Xalan is faster for the first transformation. Example:

for (unsigned int i = 0; i < 10; ++i)
{
   XalanTransformer theXalanTransformer;

   clock_t nBegin = clock();
   // Do the transform.
   theResult = theXalanTransformer.transform(
     "foo.xml"
     "foo.xsl",
     "foo.out");

   printf("transform: %.3f\n",(float) (clock() - nBegin) / CLOCKS_PER_SEC);
};

gives (on my machine):
transform: 1.402
transform: 2.553
transform: 2.414
transform: 2.834
transform: 2.854
transform: 2.654
transform: 2.754
transform: 2.714
transform: 2.653
transform: 2.234

This effect I can reproduce in my application using Xalan-C. I use a 
Xerces-C-DOM as source and constructed a XercesDOMWrapperParsedSource. The 
construction (of the XercesDOMWrapperParsedSource!) raises from 1s (first 
time) to 6s (third time). The transformation raises from 55s to 73s. If I 
build the XalanDOM from XercesDOM on my own with a DocumentBuilder, the 
building raises from 12s to 44s and the transformation from 29s to 56s. The 
memory usage in the task manager raises about 5MB in both cases.

Can somebody explain this behaviour to me? I would like to understand it.

TIA,

HolgeR

-- 
holger floerke                     d  o  c  t  r  o  n  i  c
email floerke@doctronic.de         information publishing + retrieval
phone +49 2222 9292 90             http://www.doctronic.de