Java NUX library, XPATH Performance
I am using the NUX library to run ~20 xpaths queries on an XML ~20KB in two different se开发者_C百科ttings, one in a JUnit test, the other inside a bean in a Jetty servlet (hence running in a multi-threaded scenario.) It seems like when ran in Junit, it is evaluating the XPaths in ~8ms, whereas in the Jetty servlet it is taking ~80ms to evaluate. In both cases, the XPaths and the XML files are the same. What could be causing this performance difference? Could Jetty or another service be overwriting NUX/SAX's configuration? Please note that when I am running this comparison, there is no other computation hapening in the Jetty servlet, and the servlet is configured to have a single executer thread.
Since no one else has opined, here are some possibilities:
- Since the server is multi-threaded, it may be experiencing contention for other threads.
- The available memory to the servlet is likely different than the available memory to the JUnit test. Try increasing the amount of memory allowed for servlets.
精彩评论