Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Small improvements

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Wolfgang Hoschek <whoschek AT lbl.gov>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Small improvements
  • Date: Sat, 27 Nov 2004 16:20:10 -0500

Wolfgang Hoschek wrote:


10% speedup for moving Attributes.ArrayList into Element, which makes access faster, plus saves a little memory
(keeping static accessor methods in class Attributes, and adding an "ArrayList" parameter for the attributes)

Element.java:
// private Attributes attributes = null;
private ArrayList attributes = null;

Semantics remain unchanged by this.


This one surprises me. Why would pulling the ArrayList into Element, but still using static accessor methods in another class be any improvement? Is the compiler inlining the method calls or some such?

I tried implementing this, and in my first pass memory usage actually went up by a noticeable amount, though now I think I see where my mistake was, and I should be able to fix that.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page