[Interest] Building strings with .arg() (arrrgh)

Elvis Stansvik elvstone at gmail.com
Thu Mar 5 21:29:02 CET 2020

Den tors 5 mars 2020 kl 21:24 skrev Max Paperno <max-l at wdg.us>:
> On 3/5/2020 3:11 PM, Elvis Stansvik wrote:
> > Den tors 5 mars 2020 kl 19:26 skrev Max Paperno <max-l at wdg.us>:
> >> One thing for sure, since my benchmarks, from here on I will very much
> >> prefer the "multiArg" version of .arg() vs. using multiple .arg()s.
> >
> > Closing side note: There's a a nice Clazy diagnostic for that.
> Indeed, but IIRC it only warns when using multiple strings, like
> .arg("string").arg("other"), not with, for example
> .arg("string").arg(5). Whereas it's still considerably faster (and I
> presume more "efficient") to do .arg("string", QString::fromNumber(5)).
> Even just a single .arg(QString::fromNumber(5)) seems a little faster
> than .arg(5).

Oh right, I have the memory of a gold fish, forgetting that part of
your results.

Thanks for doing those benchmarks. Maybe the Clazy check could be
improved following your findings.


> Best,
> -Max
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest

More information about the Interest mailing list