Originally posted by Ben Souther:
If you don't get a satisfactory answer for this question after a day or two, let me know and I can move it to our Threads and Synchronization forum for you.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
Well, I think Paul asked a very good question: why do you need to store the parsers in the first place? What bad happens when you simply recreate one every time?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Marcos Maia:
We have really specific performance concerns on this app. So would be better to have them reused.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Maulin Vasavada:
I agree with theories of having a pool of parsers or to create new one everytime unless you have specifically boiled down performance issue to the creation of new parser object.
As earlier mentioned, I don't think parser should have big overhead of instance variables (if it does have then the pooling should work better).
One other question I had was -- you are not in anyway transforming the xml to something different format, are you? Here are you just referring to the XML Parser, right? Because transformation would be a different thing to deal with, in which case we have to figure out if there are multiple stylesheet (sort of) to apply on single XML data model. In that case somehow we need to figure out how to Cache the stylesheet uniquely so for mulitple requests with different XML it doesn't have to process the same set of stylesheet repeatedly.
It would really helpful to know if you really have boiled down the performance issue to the particular parser creation calls.
Thanks
Maulin