[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: [Kde-pim] KDE/kdepimlibs/akonadi
From: Volker Krause <vkrause () kde ! org>
Date: 2008-04-11 7:46:35
Message-ID: 200804110946.44432.vkrause () kde ! org
[Download RAW message or body]
On Friday 11 April 2008 08:55:45 Marc Mutz wrote:
> On Thursday April 10 2008 17:35, Tobias Koenig wrote:
> > SVN commit 795521 by tokoe:
> >
> > Change all QList<QByteArray> to QSet<QByteArray> for itemParts
>
> This is a bad idea. A set doesn't pay it's weight for small numbers of
> items. In the vast majority of cases, it's faster to use a sorted
> vector/qlist instread of a set. A set is node-based, while a (q)list is
> simply an array. Locality of reference and malloc-free appends ruin set's
> day.
Right, performance-wise it's probably not the best choice, but it provides
exactly the semantics we want here: no duplicates, order doesn't matter.
That's why we decided to use it instead of a list. The performance impact
should be limited since these sets are not created very frequently (which is
the expensive part AFAIU), but mostly passed around and checked to contain a
specific value. So, I would rather enforce correctness here and keep the set,
especially since this is not an implementation detail but public API.
regards
Volker
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic