W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2000

RE: FW: adding addressing capabilities to the DOM

From: <keshlam@us.ibm.com>
Date: Tue, 18 Apr 2000 09:27:23 -0400
To: aaron@skonnard.com
cc: "www-Dom" <www-dom@w3.org>
Message-ID: <852568C5.0049E894.00@D51MTA03.pok.ibm.com>
> API. I see NodeList as a very *natural* implementation of the XPath
> node-set
> abstraction.

This has been debated in the past; I'm not sure we really want to rehash
the pros and cons of NodeLists. Brief summary of the concerns:

NodeList is explicitly defiend as being a "live view". Every time the DOM
changes, its contents may have to be recomputed, and because it's
integer-indexed that can involve a complete walk of the DOM tree. (There
are ways to optimize that slightly, but only slightly.) That computation is
significantly expensive even when matching only against the node type and
name, as now; it'd be much worse for XPath.

Part of the goal of the Traversal chapter was to get rid of this global
sensitivity and switch to localized testing, which is less expensive under
document mutation.

If you don't need a live view, you don't want NodeList -- just a vector of
nodes. If you do need a live view, I submit that you probably won't want
NodeList when you consider its real costs.

Your milage may vary.

Joe Kesselman  / IBM Research
Received on Tuesday, 18 April 2000 09:27:40 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:07 UTC