30.09.2011, 14:57, "Kent Hansen" <[email protected]>: > Hi, > You might have seen Thiago's blog about QStringLiteral [1], and his idea > on replacing QLatin1String usage by QStringLiteral in Qt (where possible). > > I like the idea, but wanted to do some benchmarking first to get an > impression of the performance impact. [2] > > My results so far (on Linux 32-bit) indicate that QString::appends are > way faster when switching to using QStringLiteral: 7x faster than > QLatin1String for a 2-character literal and 14x for a ~50-character literal. > > Now, the not-so-good news: operator==(QString) is a bit (just a bit) > slower than operator==(QLatin1String) for short strings. > It seems that, for short strings, the overhead of calling qMemEquals() > and performing its "housecleaning chores" outweigh the benefits of its > fast comparison loop. > > In other words, if someone were to optimize QString::operator==(QString) > to perform better for small strings, the total replacement would be a > done deal.
Great news! Is it possible to use this superfast QStringLiteral with Qt 4.x? -- Regards, Konstantin _______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
