Some more performance baby....
Just add a setParser() method to LocalConfiguration.java for me please. Then
the way to improve performance by 5 times is below.
No it is a not a matter of setting the parser property in config because
javax.xml.parsers.SAXParser does not have a null constructor!
I went back and looked at why I get 5 times performance improvement when
I started using javax.xml.parsers.SAXParser. The performance improvement
appears to be purely the parser is better and faster than the xerces one
used for small messages(around 200 bytes each).(I commented out all configuration
in the comparison). This means we need flexibility to choose parsers which
is not there(see below for why).
Issues to be considered during the patch
--------------------------------------------------
Unfortunately, the castor LocalConfiguration.java has no setParser method
on it, and instantiates the parser only if it has a null constructor. Guess
what, javax.xml.parsers.SAXParser does not have a null constructor.
In 1.4, you are not even supposed to instantiate it directly, rather you
are supposed to go through the factory. On top of this, I believe castor
supports 1.3 which doesn't even have the SAXParserFactory interface for instantiating
parsers. I think the best method would be to put a setParser method on LocalConfiguration.java.
It is a quick and easy patch I believe. The only thing is you will get
the same parser back every time you call getParser(). The Unmarshaller
calls getParser(). The other method might be to add setParser on the Unmarshaller
and Marshaller??? Anything is fine with me, I just need this quick little
change.
thanks,
Dean
- Re: [castor-dev] 5 times the performance patch(config irrel... Dean Hiller
- Re: [castor-dev] 5 times the performance patch(config ... Dean Hiller
- Re: [castor-dev] 5 times the performance patch(con... Keith Visco
- [castor-dev] unsubscribe Mark Cornelius
- Re: [castor-dev] unsubscribe Dean Hiller
