Hi Michael, Thank you for your answer. I am not all that experienced with XML in Java. I am not only creating a new web service, I also maintain some legacy code I inherited from my predecessor where XML needs to be processed (responses from back end are read, analyzed and data retrieved).
When I was browsing through the old code I found this comment and I wondered whether the problem is really that big: // The code uses Xalan org.apache.xpath.XPath class directly, and NOT JAXP javax.xml.xpath.XPath class. // Primary reason: performance. JAXP XPath's performance sucks big time, even with "compiled" expressions. // It is like seconds with Xalan XPath vs. minutes JAXP XPath. And it is not really surprising given that // JAXP XPath creates a lot of infrastructure objects and does a lot of lookups per invocation. // And this class does it once per Document or Node. So that's what I wanted to keep in mind when writing my web service: keeping it readable while maintaining good performance. Thank you, Jan On Tue, Apr 27, 2010 at 2:21 PM, Burman, Michael <michael.bur...@logica.com> wrote: > Hi, > > What's serious performance hit? With evaluate and factory, cache the result > and just reuse it. At least I haven't had any performance problems with it > when doing this way. Initial creation might take a while, but afterwards it > works fine. > > - Micke > > -----Original Message----- > From: Jan Vesely [mailto:jan.ves...@gmail.com] > Sent: 27. huhtikuuta 2010 12:57 > To: xalan-j-users@xml.apache.org > Subject: performance question > > Hi everyone, > > At this moment, I am working on a web service and I am looking for the most > "usable" way to handle XML. I discarded JDOM as it seems to be rather slow. > Then I got here and I found these options: > * Either I can follow the easy steps in the "5 seconds tutorial" on the Xalan > homepage (using XPathFactory) > * or I can directly create a new instance of org.apache.xpath.XPath class > > I would prefer the "factory way" as it seems to me to be more readable (I > know, a matter of taste). However, I heard that when I use the factory way > and "evaluate" method, I get a seriuos performance hit. > > Any suggestions? > > Thanks in advance, > Jan > > > Please help Logica to respect the environment by not printing this email / > Pour contribuer comme Logica au respect de l'environnement, merci de ne pas > imprimer ce mail / Bitte drucken Sie diese Nachricht nicht aus und helfen > Sie so Logica dabei, die Umwelt zu schützen. / Por favor ajude a Logica a > respeitar o ambiente nao imprimindo este correio electronico. > > > > This e-mail and any attachment is for authorised use by the intended > recipient(s) only. It may contain proprietary material, confidential > information and/or be subject to legal privilege. It should not be copied, > disclosed to, retained or used by, any other party. If you are not an > intended recipient then please promptly delete this e-mail and any attachment > and all copies and inform the sender. Thank you. > > >