SerCon, I modified the test you gave me a bit so that it is not outputting
to System.out (never a good idea for a performance test):

E:\sercon>java -classpath xalan.jar;%classpath% XalanPerformanceTest
Xalan version: 2.0.1
Finished. Duration=3696

E:\sercon>java -classpath e:\xml-xalan\java\build\xalan.jar;%classpath%
XalanPerformanceTest
Xalan version: Xalan Java 2.2.D9
Finished. Duration=3505

These measurements are within a margin of error from each other:  sometimes
the 2.0.1 version comes out slightly faster.  The test could be made a bit
more accurate by not including the Transformer construction time, and doing
a dummy transformation before the t variable is calculated, to warm up the
class loading and JIT.

I believe that, if you are measuring output to System.out, we are doing
some things in the serializer to test this case, and are performing no
buffering at all in the serializer in this case (to make it as incremental
as possible).  This could account for the large differences you are seeing.

Given this, I don't see a problem (which isn't to say that some other DOM
transformations might exhibit a problem).  Do you agree?

My modified test:

import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
import javax.xml.transform.*;
import java.io.*;
import org.w3c.dom.*;
/**
 * Insert the type's description here.
 * Creation date: (29.08.01 08:46:02)
 * @author: Steffen Fischer
 */
class XalanPerformanceTest {
/**
 * XalanPerformanceTest constructor comment.
 */
public XalanPerformanceTest() {
     super();
}
/**
 * Starts the application.
 * @param args an array of command-line arguments
 */
public static void main(java.lang.String[] args) throws Exception {
     String version =
org.apache.xalan.processor.XSLProcessorVersion.S_VERSION;
     System.out.println("Xalan version: "+version);
     org.apache.xerces.parsers.DOMParser parser = new
org.apache.xerces.parsers.DOMParser();

     parser.parse("xalantest.xml");
     Document document = parser.getDocument();

     BufferedReader file = new BufferedReader(new FileReader
("general_anzeige.xsl"));

     Templates template = TransformerFactory.newInstance().newTemplates(new
StreamSource(file));

     long t = System.currentTimeMillis();
     Transformer transformer = template.newTransformer();
     // StreamResult streamResult = new StreamResult(System.out);
     DOMSource domSource = new DOMSource();
     for (int i=0; i<50; i++) {
          transformer.clearParameters();
          // we are always using the same document here to simplify things
         domSource.setNode(document);
         java.io.ByteArrayOutputStream baos = new
java.io.ByteArrayOutputStream();
         transformer.transform( domSource, new StreamResult(baos));
     }
     t = System.currentTimeMillis()-t;
     System.out.println("Finished. Duration="+t);
     System.exit(0);

}
}

-scott




                                                                                       
                            
                    Scott Boag                                                         
                            
                                         To:     [EMAIL PROTECTED]     
                            
                    08/28/2001           cc:     [EMAIL PROTECTED]              
                            
                    09:21 AM             Subject:     Re: Performance degredation from 
Xalan-J 2.1 to 2.2(Document 
                                         link: Scott Boag)                             
                            
                                                                                       
                            



I think what you are experiencing with 2.2.x is the adaptation of the DOM
to the internal DTM.  In 2.2.x we made a performance tradeoff between
transforms from streams and SAX events, vs. DOM transformations.  (On the
other hand, some DOM transformations will actually be much faster.)

If you can provide a complete unit test that replicates the problem, I
would be interested in doing some performance profiling to see if there's
anything that can be done.

-scott




                                                                                       
                                     
                    SerCon_FischerS@WestLB-                                            
                                     
                    Systems.de                    To:     [EMAIL PROTECTED]     
                                     
                                                  cc:     (bcc: Scott Boag/CAM/Lotus)  
                                     
                    08/28/01 08:34 AM             Subject:     Performance degredation 
from Xalan-J 2.1 to 2.2              
                    Please respond to                                                  
                                     
                    xalan-dev                                                          
                                     
                                                                                       
                                     
                                                                                       
                                     





Hello,

this is more supposed to be mailed to a users list, but I haven't found
one.

We recently upgraded our production environment (Websphere 3.5, JDK 1.2.2
and Xerces 1.4.2) from Xalan 2.1 to 2.2 D6 and experienced a major
performance problem with this upgrade.
Transformations that took around 3 seconds now take 6-8 seconds.

We have cached Template objects that we use for transforming multiple
DOMSources from a JSP.

Transformer transformer =Cache.getTransformer(someThing);
StreamResult streamResult = new StreamResult(out);
DOMSource domSource = new DOMSource();
for (int i=0; i<invList.size(); i++) {
     transformer.clearParameters();
     doc = (Document) invList.get(i);
     domSource.setNode(doc);
     transformer.transform( domSource, streamResult);
}

We experimented with setting the features from the DTM: "
http://xml.apache.org/xalan/features/incremental";  and
"http://xml.apache.org/xalan/features/optimize"; with no performance gains.

We also tried release 2.2 D9 but this shows the same effect.

Can anyone help? Thanks!

Kind regards,
 Steffen



|------------------------------------+------------------------------------|
|Diese Nachricht ist vertraulich. Sie|This message is confidential and may|
|ist ausschliesslich fuer            |be privileged. It is                |
|den im Adressfeld ausgewiesenen     |intended solely for the named       |
|Adressaten bestimmt.                |addressee. If you are not the       |
|Sollten Sie nicht der vorgesehene   |intended recipient please inform us.|
|Empfaenger sein, so bitten          |Any unauthorised                    |
|wir um eine kurze Nachricht. Jede   |dissemination, distribution or      |
|unbefugte Weiterleitung             |copying hereof is prohibited.       |
|oder Fertigung einer Kopie ist      |As we cannot guarantee the          |
|unzulaessig. Da wir nicht die       |genuineness or completeness of      |
|Echtheit oder Vollstaendigkeit der  |the information contained in this   |
|in dieser Nachricht                 |message, the statements             |
|enthaltenen Informationen           |set forth above are not legally     |
|garantieren koennen, schliessen wir |binding. In connection              |
|die rechtliche Verbindlichkeit der  |therewith, we also refer to our     |
|vorstehenden Erklaerungen           |governing regulations of            |
|und Aeusserungen aus. Wir verweisen |concerning signatory authority      |
|in diesem Zusammenhang              |published in the                    |
|auch auf die  fuer uns geltenden    |standard bank or company signature  |
|Regelungen ueber die                |lists with regard to the            |
|Verbindlichkeit von                 |legally binding effect of statements|
|Willenserklaerungen mit             |made with the intent to             |
|verpflichtendem                     |obligate us.                        |
|Inhalt, die in den bank- bzw.       |                                    |
|unternehmensueblichen               |                                    |
|Unterschriftenverzeichnissen bekannt|                                    |
|gemacht werden.                     |                                    |
|------------------------------------+------------------------------------|










Reply via email to