Re: Threaded DOM operations

2010-06-22 Thread Matej Bukovinski
A single DOM operation may not be slow, but a bunch of them together can be. The problem is that sometimes I have to do a lot of DOM operations for several pages (walking the DOM three, flagging some DOMNodes, removing and shifting nodes around). I'm currently using grand central dispatch to off

Re: Threaded DOM operations

2010-06-21 Thread Jens Alfke
On Jun 21, 2010, at 3:50 AM, Matej Bukovinski wrote: > I'm using WebKit to download a bunch of websites. On those sites I need to > perform some basic DOM tree operations (e.g., removing some DOM nodes). > WebKit makes this very straightforward by using elements such as DOMNodes to > represent

Re: Threaded DOM operations

2010-06-21 Thread Mike Abdullah
In my experience, editing the DOM is very fast. If you are seeing slowness it's probably from doing huge numbers of these operations at once. So my advice would be to perform a handful of operations at a time, giving the main event loop time to run in between. Mike. On 21 Jun 2010, at 11:50, M