on 05-29-2009 12:58 PM
Hi Gurus
The slowest operations in our Java application running on NW 7.1X are XPath evaluations. We are using Java XPath processing API from JRE 1.5. Internally they are constantly performing search/initialization for Apache XPath processing factory and it takes much time. I'm talking about javax.xml.xpath.* API.
Do you know how to speed up the XPath evaluations? Is this the right forum for such questions?
Thanks and Regards, Sergei
Actually I tried the following approach...
The most time consuming task was a creation of instance of DTMManager for each XPath evaluation procedure. Internally the operation performs a search for suitable class-implementation of DTMManager in the following order:
1. query the system property using System.getProperty
2. read $java.home/lib/propertiesFilename file
3. read META-INF/services/factoryId file
Step 3 is the most time consuming task. Step 1 is very fast, but there is no any JVM system property set with reference to DTMManager class. This was a goal how I improved the performance here: I tried to setup JVM system property before any XPath evaluation:
final String DTM_MANAGER_PROP_NAME = "com.sun.org.apache.xml.internal.dtm.DTMManager";
boolean setDTMManager = (System.getProperty(DTM_MANAGER_PROP_NAME) == null)
if (setDTMManager) {
System.setProperty(DTM_MANAGER_PROP_NAME, "com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault");
}
try {
return xPathProcessor.evaluate(xPath, node, returnType);
} finally {
if (setDTMManager) {
System.clearProperty(DTM_MANAGER_PROP_NAME);
}
}
What do you think about the solution? Is it acceptable on SAP Netweaver Java 7.1X?
Thanks and Regards, Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siarhei,
I checked the thing and came out across TDOM it says TCIDom speeds up the process.Please check TDOm site using search engine.Hope your query resolves soon.
Have a best day ahead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.