W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2002

Re: TreeWalker detach()

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Fri, 18 Jan 2002 15:55:55 -0500
To: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Cc: www-dom@w3.org
Message-ID: <OF6A61C501.F63EC61E-ON85256B45.0072219A@pok.ibm.com>

>Is there any particular reason NodeIterator has a detach() method and
>TreeWalker doesn't?

Because NodeIterator repairs itself as the document changes under it ("list
position semantics"), its implementations may involve event listeners or
the like which impose a performance burden on the DOM as long as the
NodeIterator is active. Having a way to deactivate it is therefore
important. Being able to do so immediately, rather than waiting until the
garbage collector (in GC langauges) gets around to cleaning it up, may make
a significant difference in application performance.

TreeWalker's "current node semantics" do not require fixup in response to
document mutation, so the same situation doesn't arise.

______________________________________
Joe Kesselman  / IBM Research
Received on Friday, 18 January 2002 15:56:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:55 GMT