[Development] Feature Freeze Exception: QStringView

Marc Mutz marc.mutz at kdab.com
Tue Jan 31 18:39:43 CET 2017


On Tuesday 31 January 2017 15:24:18 Philippe wrote:
> For instance, a method such as:
> 
> QLabel::setText(...)
> 
> stores the passed argument somewhere. A malloc will be needed if
> QStringView is the interface and a QString the passed argument.
> 
> Ok, this example is not a performance critical case.
> 
> I just want to highlight, that QStringView is not COW friendly. AFAIK.

Q6String will likely have the small-string optimisation, so short strings 
aren't actually COWed, but deep-copied. Passing through QStringView then is 
about the same efficiency as passing through a const QString&.

But that's why we'll have QStringView Level 3, where only the QStringView 
QLabel::setText() overload will be compiled in. Then, we compile Qt with 
either level and check the respective performance of the result. I'll wager 
that the results will be very interesting.

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts



More information about the Development mailing list