> I very much like the idea that, if the same xpath exprs occurs more than > once, I can reuse the xpath instance. > I also see that point that the outer xpath object only would save us +/- > 3 % of the entire object tree. However, it is unfortunately rare that > the same xpath-expression occurs more than one or two times, which means > one has to create several XPath instances.
Just one or two times in the life of the universe? Each time the page is loaded, the xpath on the page gets used, no? If you have an index.jsp, which has an XPath, each request to index.jsp uses the page. Construct that xpath one time, and save it somewhere. > So if there was a possibility to reuse a xpath instance, each time with > different exprs, I think it would be a big performance gain. This is due > to the fact that, each time I need to create a new xpath, this object > would have to be placed on the heap. I could add the functionality, but it doesn't really buy you much. > Most of my JSP-pages contains between different 15-35 xpath expressions, > and my application should scale for a lot of threads( couple of hundreds > ). So even if an setExpression method wouldn't save much of the entire > object tree, it would prevent a lot of heap entries. With let's say an > average of 20 xpath exprs per page, and 200 threads, I could end up with > only 200 heap entries instead of 4000 (20*200). > > So what do you say? > > All help are as always appreciated. Just as the app server doesn't (hopefully) re-parse the JSP for each request, you likewise shouldn't re-parse the XPaths contained on the page. Other comitters want to cast thoughts or votes? -bob _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest