[jdom-interest] Reusable JDOM Elements

Henry Charlton henryc at nortelnetworks.com
Fri Nov 15 08:05:10 PST 2002


In my implementation, I was able to identify user-defined types of JDOM
elements, each supported by a factory.  The factory supports recycling when
its element pool is not empty, and would use object creation when it was.  
 
I used a mixin to add the necessary reuse methods to my user - defined
classes.
 
I hesitate to attribute exact performance metrics to this technique, as the
addition of reusable JDOM elements was part of a larger performance
optimization effort, which addressed many other issues.  However, having
said that, the final result of the performance improvement efforts was that
we saw an 8 - fold increase in the file throughput of our application.
Obviously, the memory requirements of our application fell dramatically.
 
I would like to put in a plug for a resource that I found most helpful in
our efforts:
 
"Java Performance Tuning" by Jack Shirazi, O'Reilly & Associates ISBN
0-596-00015-4
 
 
 
--Henry
 

-----Original Message-----
From: Martin Schulz [mailto:schulz at videotron.ca] 
Sent: Monday, November 11, 2002 7:37 PM
To: jdom-interest at jdom.org
Subject: RE: [jdom-interest] Reusable JDOM Elements


Henry,
 
could you elaborate just a little?
 
A straight forward reference counting implementation would be intrusive,
wouldn't it?
Then we would still have the problem that an element (or any other 'node')
can just have one parent...
 
Am I correct in assuming that you used an external reference holder, which
was then used to identify and detach the recyclable pieces?
 
Now for me that would only be half of the solution, as I would have to
provide either a pooling solution for multiple
copies of these pieces, or implement a synchronization point for resource
access.
 
Also was there a performance gain obtained in your solution?
 
Thanks!
 
    Martin

-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org] On
Behalf Of Henry Charlton
Sent: November 11, 2002 3:02 PM
To: jdom-interest at jdom.org
Subject: RE: [jdom-interest] Reusable JDOM Elements



In the past, I have successfully combined JDOM Elements with reference
counting.  

Once the xml file was generated, I would traverse the document from the root
element, making detach() calls. 


--Henry 



-----Original Message----- 
From: Norrman Per [mailto:per.norrman at canovia.se
<mailto:per.norrman at canovia.se> ] 
Sent: Monday, November 11, 2002 4:25 AM 
To: 'Martin Schulz'; jdom-interest at jdom.org 
Subject: RE: [jdom-interest] Reusable JDOM Elements 


Hi, 



More information about the jdom-interest mailing list