[jdom-interest] Element Reference from Attribute

Jason Hunter jhunter at collab.net
Mon Nov 20 10:19:10 PST 2000


> Just curious, but what size documents are people working on, in
> what kinda of memory environment.  We keep hearing 'adds 4 bytes'.
> 
> But, in a document with 10,000 attributes/PI/comments, that's 40,000
> bytes, which is a tad under 40K.

My earlier example was a 300K file I use regularly with 10K elements,
and so to add 4 bytes to each element was 40K extra, or an addition of
13%.  It'd be similar for attributes assuming an average of one
attribute per element.

> I personally can spare 40K.  

It's important we remain thinner than the common DOM implementations. 
However, since adding parentage to attributes/PIs/comments would solve
the "double addition" problem in addition to making available a
getParent() method, it seems like we could kill two birds with four
bytes.  :-)

BTW, it doesn't seem right to create a subclass to handle this for
various reasons, most obvious that we lose the "double addition"
protection.

-jh-



More information about the jdom-interest mailing list