qt6-bb10/tests/benchmarks/corelib/tools
Thiago Macieira c250a0ec3a Unify and optimize QByteArray::to{Upper,Lower}
Do a check first if we need to transform before doing the transform.
This means we won't detach when transforming data that is already
correct.

And instead of using QChar, use our own hand-rolled table. In a proper
LTO build, the QChar calls would be resolved to a lookup of the Unicode
data, but not many people do LTO builds, Therefore, this means a great
speed-up is achieved by simply avoiding the function call. The extra
gain in performance comes from the simpler translation table instead of
the more complex full-Unicode data.

Also as a consequence, this changes the handling of two characters in
Latin 1: 'ß' should be uppercased to "SS" but we won't do it, and 'ÿ'
can't be uppercased in Latin 1 ('Ÿ' is outside the range).

Benchmarking is included. Comparing the Qt 5.4 algorithm to the new code
is almost 20x faster. Other alternatives are included in the benchmark
and are all faster than the current code, though slower than the new
one. While all of them could compress the tables to be smaller or shared
between uppercasing and lowercasing, they would also expand to more code
(though probably less than the extra bytes required in the full
translation table). In the trade-off, I decided to go with simplicity
and most efficient code.

Change-Id: I002d98318d236de0d27ffbea39d662cbed359985
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-19 03:39:05 +02:00
..
containers-associative Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
containers-sequential Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qalgorithms Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qbytearray Unify and optimize QByteArray::to{Upper,Lower} 2014-08-19 03:39:05 +02:00
qchar Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qcontiguouscache Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qcryptographichash Add a benchmark test for QCryptographicHash 2014-04-04 01:29:37 +02:00
qdatetime Fix some compiler warnings in benchmark tests. 2014-07-14 10:55:55 +02:00
qhash Update the qHash function for strings to use the CRC32 instruction 2014-01-23 01:06:34 +01:00
qlist Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qlocale Remove QLocalePrivate::m_localeID 2013-04-23 18:57:45 +02:00
qmap QMap - add insert overload that provide a hint 2013-03-06 18:56:17 +01:00
qrect Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qregexp Check for boost header in sysroot 2014-07-10 08:10:52 +02:00
qringbuffer Rewrite QRingBuffer 2014-07-24 17:31:20 +02:00
qset Iterate over the smaller set in QSet::intersect(). 2013-06-05 09:35:42 +02:00
qstring Trim the QString benchmark test 2014-08-09 15:36:36 +02:00
qstringbuilder Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qstringlist Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qvector Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
tools.pro Integrate tst_bench_qringbuffer into the build tree. 2014-07-25 17:50:30 +02:00