Hmm... well, without looking at your diff, I defaulted m_pw to null, and
only create it lazily.   In a crude test I ran I don't see any difference
in the benchmark, though I suppose it might depend on what you are
measuring.  In any case, it's probably not a bad idea to not create this
unless it is required.

-scott




                                                                                       
                                 
                    "Vadim Gritsenko"                                                  
                                 
                    <vadim.gritsenko@ve       To:     <[EMAIL PROTECTED]>       
                                 
                    rizon.net>                cc:                                      
                                 
                                              Subject:     Performance issue with 
DefaultErrorHandler                   
                    01/28/2002 10:08 AM                                                
                                 
                    Please respond to                                                  
                                 
                    xalan-dev                                                          
                                 
                                                                                       
                                 
                                                                                       
                                 




Hi,

I'm Cocoon developer, and while doing some performance tests to find out
hotspots and possible optimizations, I found quite interesting
Xalan-related
thing.

The class org.apache.xml.utils.DefaultErrorHandler has following piece
of code
in it:

  public DefaultErrorHandler()
  {
    m_pw = new PrintWriter(System.err, true);
  }

And this, according to OptimizeIt, takes 42.72% of time on my Cocoon
performance tests. This was hard to believe, so I got Xalan CVS and
quickly
hacked this class to remove this "new PrintWriter()". The results are
astonishing: now test runs at 386% speed; this is decrease in processing
time
from 498 ms to 129 ms!

I believe that somebody from Xalan committers would find this
interesting and
would like to review this class and come up with solution which will
improve
overall Xalan performance.

Attached are the changes that I quickly made for my test.

Regards,
Vadim






Reply via email to