On Wed, 2008-05-07 at 22:52 -0400, Joerg Heinicke wrote: > On 30.03.2008 02:50, Joerg Heinicke wrote: > > >> Author: antonio > >> Date: Tue Feb 19 22:42:45 2008 > >> New Revision: 629374 > >> > >> URL: http://svn.apache.org/viewvc?rev=629374&view=rev > >> Log: > >> Faster implementation. > > > > Saw this one only now ... I'm a bit concerned about the approach. > > > > First, do you really think this implementation is significantly faster? > > Your implementation only "caches" the parser instance, you replace the > > instantiation with ThreadLocal handling. Parsing itself should still be > > the slowest part. How many Strings do you convert to SAX per thread? > > Second, who cleans up the thread before it goes back to the thread pool? > > > > At the end is it really worth the "ugly" implementation? > > > > IMO it's a much better approach to make it a "real" Cocoon component > > (Serializeable) instead and look up the SAXParser. > > Any opinions on this one? > > Joerg > > [1] http://marc.info/?l=xml-cocoon-cvs&m=120348979305179&w=4
What happens if an exception leaves the parser in a messy state when it is reused? Is there any rule which would guarantee that this should never happen for the average SAXParser implementation? Cheers, Alfred.