[jdom-interest] question about running speed

Gu Xueying (Shinnie Gu) Shinnie.Gu at iuniverse.com.cn
Wed Apr 10 00:50:05 PDT 2002


Jason:
I am using jdk1.4 now. It is true that running a jdom program(beta 8) under
jdk1.4 is faster than jdk 1.3 about 30-40%.

Shinnie Gu
IUniverse(Shanghai)Co.,Ltd.
Tel:8621-58305001 Ext.8701



-----Original Message-----
From: Jason Hunter [mailto:jhunter at servlets.com]
Sent: 2002Äê4ÔÂ10ÈÕ 15:47
To: Dennis Sosnoski
Cc: Gu Xueying (Shinnie Gu); jdom-interest at jdom.org
Subject: Re: [jdom-interest] question about running speed


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.

-jh-



More information about the jdom-interest mailing list