[Development] Important recent changes in QList/QString/QByteArray

André Pönitz apoenitz at t-online.de
Thu Sep 3 03:22:10 CEST 2020


On Wed, Sep 02, 2020 at 09:37:49PM +0200, Giuseppe D'Angelo via Development wrote:
> On 02/09/2020 21:18, Andrei Golubev wrote:
> > Also not sure whether it is an implementation detail or the behavior
> > that should always be anticipated.
> 
> People build performance sensitive code assuming the cost of certain
> operations -- like, assuming that erasing elements from a vector never
> reallocates it; and that the only operation that sheds capacity is
> squeeze(), everything else (incl. clear(), incl. resize(0)) keeps the
> capacity (*). We should stop backstabbing them...

People do not build *truly* performance sensitive code using Qt containers.

The reference counting is very convenient, but it comes with a price tag
for non-const item accesses for checking the reference count. 

In the (absolutley rare) cases of "performance trumps everything" *this*
is not acceptable.

The only backstabbing that happens in this area is the removal of Qt
container convenience functionality based on performance arguments that
are not applicable in almost all cases, or on a "does not exist in the
Standard Library so it can't be good" base.

Andre'


More information about the Development mailing list