[Development] Views (was: Re: QList for Qt 6)

Иван Комиссаров abbapoh at gmail.com
Thu May 16 20:00:58 CEST 2019



> 16 мая 2019 г., в 18:29, Thiago Macieira <thiago.macieira at intel.com> написал(а):
> 
> When you first design the class, sure. But 5 years later, you may have the 
> data internally kept in a QMap or QHash, mapped to some other information. So 
> your function that used to "return d->member;" now does 
> "return d->member.keys();»

And now trivial getter allocates and has an O(N) complexity.

> 
> Another case would be where you're keeping extra data in the internal 
> structure and you need to filter that out before returning. 

And now trivial getter allocates and has an O(N) complexity.

Please, don’t do changes like that. It’s really not cool to find *interesting* things in a profiler after the Qt upgrade.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190516/324df795/attachment.html>


More information about the Development mailing list