[Development] Qt6 source changes

Olivier Goffart olivier at woboq.com
Fri Nov 2 10:06:57 CET 2018


On 02.11.18 09:20, Ulf Hermann wrote:
>> Depends on usage.
>>
>> See e.g. 551efd91990e07902e5324f720cf5585865c323d
>>
>>      QmlProfiler: Use QList for QmlRange container when loading .qtd
>>       
>>      As we are using this as a queue, with many calls to takeFirst(), a
>>      QVector is prohibitively expensive here.
> 
> I should have used QQueue there, and that will hopefully still be a
> linked(-ish) list in Qt6. Or it might become a ring buffer, but please
> not a plain vector.
> 
> If we don't want to keep QQueue, I will still have the option to use an
> equivalent std container there (+/- implicit sharing).

Right, in this case std::deque would probably be a better fit. You do not need 
implicit sharing, and std::deque still tries to optimize for cache, and will 
not call the move constructor on every element each time it has to "re-locate"
(We should probably deprecate QQueue right now and tell people to use std::deque)

-- 
Olivier

Woboq - Qt services and support - https://woboq.com - https://code.woboq.org




More information about the Development mailing list