[jdom-interest] JDom-Dokument: Serialized oversized

Joseph Bowbeer jozart at csi.com
Fri May 4 13:58:52 PDT 2001


Elliotte Rusty Harold writes:

> Java object serialization is notoriously bloated, slow, and inefficient.

That's true concerning the default serialized format, but I don't believe
it's true in general.

Dennis Sosnoski suggested an efficient format in the following message (as
part of "TODO: serialization [eg]" thread in April).

http://lists.denveronline.net/lists/jdom-interest/2001-April/005728.html

[ ... ]

"For best overall performance you'd probably want to write and read names
(elements, attributes, namespaces, etc.) as String objects, using the
writeObject/readObject methods of ObjectOutput/ObjectInput; that way there'd
only be a single copy of the name text in the serialized form, with
references to it when it's reused (this assumes that the name Strings are
reused, which I know at least some parsers do).  Attribute values and
content data Strings could be written/read as UTF text (using
writeUTF/readUTF) to avoid the bookkeeping overhead of serialization.

This would give a several times speed improvement for serialization, while
also significantly reducing the serialized form size. It'd also be
considerably more compact than the actual XML."









More information about the jdom-interest mailing list