[jdom-interest] question about running speed
jhunter at servlets.com
Wed Apr 10 00:47:01 PDT 2002
Dennis Sosnoski wrote:
> I'll update the test results at
> http://www.sosnoski.com/opensrc/xmlbench/index.html later this month,
> but from what I've seen in running through the last test set again beta
> 8 is generally about 10-30% slower on building the document
> representation than beta 7.
Beta8 does more checking during builds than Beta7 did, which explains a
lot of the slowdown. I found the speed also varied a lot depending on
the JDK you were using. JDK 1.4 looks better than JDK 1.2 because how
we use StringBuffer to manage the text content depends a lot of how the
StringBuffer class is implemented. There's a buf.copy() bottleneck I
noticed in JDK 1.2 that doesn't seem to exist in JDK 1.4. Which JVM are
you using, Dennis?
> Walking through the document representation is generally about twice as
> fast with the new list code, so at least that's a very nice gain.
That's very likely due to the better FilterList implementation.
> It looks like memory usage has gone up substantially, though, and you're
> working with a large file. If you were near the limit before the change
> probably would have put you all the way into the thresh zone. Try
> increasing the JVM memory when you run your program (perhaps use "java
> -Xms128M -Xmx128M", assuming you've got at least 128M in your machine).
This also seemed to vary for me depending on JVM. Someone reported a
JDK 1.1.x bug regarding memory that wouldn't free up. I think the same
bug may be present in JDK 1.2 from looking at the code.
More information about the jdom-interest