[jdom-interest] Thread questions regarding JDOM SAXBuiler?

Laurent Bihanic laurent.bihanic at atosorigin.com
Wed Sep 1 07:54:47 PDT 2004


I don't think your test tool performs enough iterations for the result to be 
reliable due to garbage collector side-effects.
I modified your tool to run 1000 iterations instead of 20 :

java -XX:+AggressiveHeap large.ThreadedReader

Reuse=true      size=21837      time: 42497
Reuse=false     size=21837      time: 40796

Reuse=true      size=1927       time: 3403
Reuse=false     size=1927       time: 11125

Reuse=true      size=21837      time: 28469
Reuse=false     size=21837      time: 35527

Reuse=true      size=43469      time: 57238
Reuse=false     size=43469      time: 63963

Reuse=true      size=325632     time: 428557
Reuse=false     size=325632     time: 443638

...


Per Norrman wrote:

> Hi,
> 
> I meant to make the program self-cotained but missed the dependency
> on the concurrent jar. Here's a new version. You should run the test
> in your environment to confirm the results.
> 
> Yes, documents are discarded after being built. There are many variations
> you can do in a test like this. My guess is that it's String/StringBuffer
> handling in SAXBuilder and/or Xerces that accounts for the resuts.
> 
> A typical output in my environment (P3, 850Mhz, Dell Latitude C600):
> 
> Reuse=true    size=21731    time: 5720
> Reuse=false    size=21731    time: 2215
> 
> Reuse=true    size=1918    time: 200
> Reuse=false    size=1918    time: 300
> 
> Reuse=true    size=21731    time: 1200
> Reuse=false    size=21731    time: 2065
> 
> Reuse=true    size=43259    time: 3697
> Reuse=false    size=43259    time: 2663
> 
> Reuse=true    size=324070    time: 25435
> Reuse=false    size=324070    time: 22233
> 
> Reuse=true    size=756109    time: 66417
> Reuse=false    size=756109    time: 53194
> 
> The first run should be disregarded. Used for warming-up.
> 
> /pmn


More information about the jdom-interest mailing list