Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] indexOf O(1) patch?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: Wolfgang Hoschek <whoschek AT yahoo.com>, xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] indexOf O(1) patch?
  • Date: Tue, 1 Feb 2005 20:55:29 -0800

On Feb 1, 2005, at 8:46 PM, Elliotte Harold wrote:

Wolfgang Hoschek wrote:


As an aside, if i remember it correctly, the BinaryXMLCodec deserializes in a more compact manner, somewhere around 4 memory bytes per file byte.


Now how does it do that? If it's starting with the same XML document and eventually arriving at the same XOM Document object, albeit with a detour through binary XML, that's a bit surprising. Is it interning strings the standard builder is not interning?

It's interning *all* strings (but not with String.intern(), but rather with a better application-level scheme). A large fraction of the binary data is essentially an array of unique string occurances, stored in compact form. Then there are byte level tokens identifying node types and compact byte-level integer indexes referring to the string table.

Beyond that, it also using the XOM Node copy constructors as much as as possible, to share more memory, faster object construction, and to avoid reverification of things that have already been verified before.





Archive powered by MHonArc 2.6.24.

Top of Page