xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] Unicode forms for internal storage&In-Reply-To=20030420212424.77D5824AEB6 AT mail.ibiblio.org
- From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
- To: DHollenbeck <dick AT softplc.com>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Unicode forms for internal storage&In-Reply-To=20030420212424.77D5824AEB6 AT mail.ibiblio.org
- Date: Thu, 22 Jan 2004 10:04:14 -0500
At 12:58 PM -0600 1/21/04, DHollenbeck wrote:
On this basis, I would think that an object of this type is optimal speed/size tradeoff:
char[]
Yes, just a char[] array. One that can be passed to the String() constructor.
Currently I'm using a byte[] array in Text. Most of the strings in other classes (e.g. element names, namespace prefixes, etc.) are interned which helps a lot.
Also, at some point I would have incorporated the embedded ArrayList object's functionality that you have in your Node hierarchy into the parent Node class itself. You'll get both speed and memory pickup doing this.
i.e. make your Node (or whatever the parent class is) incorporate the [customized] functionality of ArrayList into its methods such that you no longer need to include ArrayList as a member. You will reduce the Java Object count by the number of Nodes in the XML document, this means less memory, faster instantiation time, etc.
I might try this post 1.0. It should be doable completely in the private parts. It would need profiling to prove that it really works. A couple of other benfits I see to this approach:
1. It would make it easier to back port to 1.1 if I don't depend on the Collections API.
2. Debugging would be easier because variable inspection would have one less level of indirection.
--
Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA
-
[XOM-interest] Unicode forms for internal storage&In-Reply-To=20030420212424.77D5824AEB6 AT mail.ibiblio.org,
DHollenbeck, 01/21/2004
- Re: [XOM-interest] Unicode forms for internal storage&In-Reply-To=20030420212424.77D5824AEB6 AT mail.ibiblio.org, Elliotte Rusty Harold, 01/22/2004
Archive powered by MHonArc 2.6.24.