[jdom-interest] performance on tonights CVS

Alex Rosen arosen at silverstream.com
Fri Mar 15 10:26:49 PST 2002


> Ideas are most welcome, but if nothing surfaces I'm tempted to remove
> that verification check.  For the price, I think it provides minimal
> benefit.

Amen! The requirement that it be impossible to build a non-well-formed
document always seemed... overly nice, to me. It's great to help developers
out by catching errors for them when it's cheap, but not when it's
expensive. It's not fair that you have to pay the price, even if your code
does the right thing.

What if we didn't call the Verifier anywhere, but we added checkElement()
and checkDocument() to it? That way a developer could optionally check their
document, after they created it in-memory. If you're parsing a file (using a
parser that does the proper checks), or if you're building a document
in-memory but can guarantee that you're only adding legal values (e.g. if
all the data you added were integers), then you wouldn't have to pay the
price. We could move all non-free checks there, such as AttributeList's
checks for duplicate attributes. (Maybe that's cheap enough to leave as-is,
dunno.)

Alex




More information about the jdom-interest mailing list