Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

x:forEach too slow  RSS feed

 
Markus Neumaier
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm parsing a xml-File with, give or take, 85000 lines.



This Displays about 180 Devices and takes ~20 Seconds. In the final Version i do much more within the forEach. But to check the performance I removed every function / iteration within the forEach.
Is that a normal runtime for this kind of xml + JSP.

The System:
Windows Server 2008 R2 Standard
Intel Xeon E7-4870
4GB RAM
Tomcat 7
Eclipse Java EE IDE for Web Developers

If this is a "normal" parsing / evaluation time, are there more performant ways to do this? If its not a normal reaction time, any ideas why it takes this long?

Thank You

Markus


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

XPath is just naturally slower than direct manipulation of an XML DOM.

I would write a helper class that keeps an up to date copy of your XML document as a DOM and works with it using standard library functions.

Bill


 
Markus Neumaier
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

after researching some more I found out that there is a problem with the xml-library in JSP's (atleast in earlier versions). They report an exponential runtime with the combination of x:forEach around a x:out. Apparently it has to do something with the uncached xml-library.
Maybe i can write a .xsl that does the right transformation and outputs the xml. But i need to include a Class (Java Bean) and get some attributes from it and i dont really know if that is possible.

Markus
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!