[Development] Feature Freeze Exception: QStringView

Kevin Kofler kevin.kofler at chello.at
Thu Feb 2 23:52:26 CET 2017


> On Tuesday 31 January 2017 15:24:18 Philippe wrote:
>> I just want to highlight, that QStringView is not COW friendly. AFAIK.

That alone makes it actually a pessimization.

Marc Mutz wrote:
> 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&.

As I already wrote, I think that that is also not a good idea at all. The 
smallness of QString makes it very efficient to pass around. And you will 
not be able to assume things like AVX moves any time soon: Currently, on 
Fedora, 32-bit x86 code may not even require MMX, let alone SSE/SSE2; x86_64 
code can require MMX, SSE and SSE2, but nothing beyond that; 32-bit ARM code 
is also not allowed to require NEON.

> 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.

If you think so, then why don't you provide such results BEFORE getting the 
changes merged, potentially leaving Qt with a counterproductive API addition 
that it will not be able to get rid of anymore?

        Kevin Kofler




More information about the Development mailing list