[KPhotoAlbum] Performance issues

Robert L Krawitz rlk at alum.mit.edu
Fri Feb 10 02:24:59 GMT 2006


I have a suspicion that a lot of the performance issues I'm seeing are
due to the user of QValueList to store the list of images.  That would
certainly explain why displaying the last page of thumbnails is much
slower than displaying the first page.

QString ThumbnailView::ThumbnailView::fileNameInCell( int row, int col ) const
{
    uint index = row * numCols() + col;
    if ( index >= _imageList.count() )
        return QString::null;
    else
        return _imageList[index];
}

The operator[] becomes this:

template <class T>
Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::NodePtr QValueListPrivate<T>::at( size_type i ) const
{
    Q_ASSERT( i <= nodes );
    NodePtr p = node->next;
    for( size_type x = 0; x < i; ++x )
	p = p->next;
    return p;
}

So basically the thumbnail display is quadratic in the total number of
images.  Yuck.

-- 
Robert Krawitz                                     <rlk at alum.mit.edu>

Tall Clubs International  --  http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail lpf at uunet.uu.net
Project lead for Gutenprint   --    http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton




More information about the Kphotoalbum mailing list