Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-27 Thread Kentaro Hara
> From your design document, it sounds like this approach retains > guardRef/selfOnlyRef, and will not let a disconnected subtree keep the owner > document's children alive. Am I understanding correctly? Yes! - The approach retains guardRef/selfOnlyRef. - Assume that someone refers to a docume

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-27 Thread Maciej Stachowiak
>From your design document, it sounds like this approach retains >guardRef/selfOnlyRef, and will not let a disconnected subtree keep the owner >document's children alive. Am I understanding correctly? - Maciej On Jun 27, 2012, at 5:55 AM, Kentaro Hara wrote: > I wrote a document and impleme

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-27 Thread Kentaro Hara
I wrote a document and implemented a patch of a new reference counting algorithm. The reference counting algorithm guarantees that "If a Node X has 1~ reference count, then all the Nodes in the same tree are kept alive". No performance regression. No additional byte in each Node object. A design d

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-12 Thread Filip Pizlo
On Jun 11, 2012, at 11:35 PM, Ojan Vafai wrote: > On Mon, Jun 11, 2012 at 9:32 PM, Filip Pizlo wrote: > I think that a lot of the performance penalty can be alleviated by: > > 1) Moving rarely executed paths into non-inlineable methods. > > 2) Marking the various refing methods ALWAYS_INLINE,

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-11 Thread Ojan Vafai
On Mon, Jun 11, 2012 at 9:32 PM, Filip Pizlo wrote: > I think that a lot of the performance penalty can be alleviated by: > > 1) Moving rarely executed paths into non-inlineable methods. > > 2) Marking the various refing methods ALWAYS_INLINE, after you've moved as > much as possible out of line.

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-11 Thread Kentaro Hara
Hi ggaren and pizlo Sorry for posting a not-yet-optimized WIP patch. I'll re-post it after optimization you suggested. Also, I described the algorithm I am now implementing. I guess that this algorithm would have less overhead: https://bugs.webkit.org/show_bug.cgi?id=88834#c3 On Tue, Jun 12,

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-11 Thread Filip Pizlo
I think that a lot of the performance penalty can be alleviated by: 1) Moving rarely executed paths into non-inlineable methods. 2) Marking the various refing methods ALWAYS_INLINE, after you've moved as much as possible out of line. 3) Using LIKELY and UNLIKELY where appropriate. The reaso

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-11 Thread Geoffrey Garen
> Actually I've tried the approach yesterday but confirmed 25.9% > performance regression, even if I have TreeShared hold a pointer to > the root. Please look at the WIP patch and the performance test in > https://bugs.webkit.org/show_bug.cgi?id=88834. > > What I've learned is that we must not ins

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-11 Thread Geoffrey Garen
>> IMHO, (a) would be the best semantics. > > I agree, and I think that the specification actually does require this. > > The real issue here is how to fix this bug efficiently. I believe that Geoff > Garen has been contemplating this and also has a proposal for how to do it. I believe you coul

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-11 Thread Kentaro Hara
Thanks ggaren! I filed a bug here: https://bugs.webkit.org/show_bug.cgi?id=88834 > I believe you could achieve (a) (i.e., preserve all reachable nodes without > help from the JavaScript garbage collector) with these semantics in the C++ > DOM: > > = Design = > > ref(): > > ++this->refC

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-11 Thread Kentaro Hara
Thanks Maciej I am trying to implement a WIP patch that guarantees "Reachable DOM nodes are kept alive", without regressing performance nor without adding member variables to Node objects. The patch will remove guardRef() as a natural consequence. Although I'm not 100% sure if the work succeeds or

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-11 Thread Maciej Stachowiak
On Jun 6, 2012, at 6:27 PM, Darin Adler wrote: > On Jun 6, 2012, at 6:14 PM, Kentaro Hara wrote: > >> IMHO, (a) would be the best semantics. > > I agree, and I think that the specification actually does require this. > > The real issue here is how to fix this bug efficiently. I believe that

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-06 Thread Dominic Cooney
On Thu, Jun 7, 2012 at 10:27 AM, Darin Adler wrote: > On Jun 6, 2012, at 6:14 PM, Kentaro Hara wrote: > > IMHO, (a) would be the best semantics. > > > I agree, and I think that the specification actually does require this. > > The real issue here is how to fix this bug efficiently. I believe tha

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-06 Thread Darin Adler
On Jun 6, 2012, at 6:14 PM, Kentaro Hara wrote: > IMHO, (a) would be the best semantics. I agree, and I think that the specification actually does require this. The real issue here is how to fix this bug efficiently. I believe that Geoff Garen has been contemplating this and also has a proposa

Re: [webkit-dev] DOM tree traversal on detached nodes

2012-06-06 Thread Kentaro Hara
> The semantics will fix the > FIXME > in JSC GC. Sorry, the link was wrong. Correction: Here