[Development] RFC: Proposal for a semi-radical change in Qt APIs taking strings
Thiago Macieira
thiago.macieira at intel.com
Tue Oct 20 08:42:50 CEST 2015
On Tuesday 20 October 2015 09:44:23 Marc Mutz wrote:
> So if deep copies loose their ineffciency myth, what reason remains to not
> use QSV in all functions taking QString?
Complicating the API.
You cannot possibly prove that doing something O(n) is as efficient as doing
something O(1), therefore there's no way that deep copies would be a myth.
COW may have comparable performance to deep copies if you consider the whole
picture and code written properly. Our code was written for COW, so I doubt
that you would get the same performance by suddenly making deep copies.
To summarise:
1) I'm ok with adding QStringView
2) I'm ok with using QStringView in applications, no restraints
3) I'm ok with exploring the use in API, in parameters
4) I'm ok with exploring it in return values, in very limited conditions that
are being studied very well, ahead of time
Exploring does not mean you can go and start adding overloads everywhere.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list