[Patch] HTMLCollection cache (was: phpnuke 7.3 slowness)

Koos Vriezen koos.vriezen at xs4all.nl
Wed Sep 8 23:20:23 BST 2004


On Wed, Sep 08, 2004 at 10:28:30AM +0200, David Faure wrote:
> On Wednesday 08 September 2004 09:09, Koos Vriezen wrote:
> > On Sat, Sep 04, 2004 at 06:29:55PM +0200, Koos Vriezen wrote:
> > > On Sat, Sep 04, 2004 at 04:20:16PM +0200, Koos Vriezen wrote:
> > > > Unfortunately, HTMLCollectionImpl::getItem only digs inside the tree, so
> > > > as soon as we hit a lastChild leaf, we must start again for
> > > > HTMLCollectionImpl::item. Still this give a more then five time speedup.
> > > > The length calculation is reduced to only one in the above case.
> > > 
> > > Silly me, HTMLCollectionImpl::nextItem has a way to do that smart. So
> > > attached an even faster one :-)
> > 
> > Actually given this patch, doesn't it make sense to implement 
> > HTMLCollectionImpl::firstItem as HTMLCollectionImpl::item(0) and
> > HTMLCollectionImpl::nextItem as HTMLCollectionImpl::item(cached_pos+1),
> > and mark these as deprecated in dom/html_misc.h? Not only are they
> > not needed anymore, they are not safe for domtree changes while iterating
> > in the current implementations.
> 
> OK.

Done, but now I found a bug. Of course the base doesn't have to be the
document. Will fix tomorrow.

Thanks,

Koos




More information about the kfm-devel mailing list