qt5base-lts/tests/benchmarks/corelib/tools
Thiago Macieira ea8e48a679 Update the qHash function for strings to use the CRC32 instruction
According to my profiling of Qt Creator, qHash and the SHA-1 calculation
are the hottest spots remaining in QtCore. The current qHash function is
not really vectorizable. We could come up with a different algorithm
that is more SIMD-friendly, but since we have the CRC32 instruction that
can read 32- and 64-bit entities, we're set.

This commit also updates the benchmark for QHash and benchmarks both
the hashing function itself and the QHash class. The updated
benchmarks for the CRC32 on my machine shows that the hashing function
is *always* improved, but the hashing isn't always. In particular, the
current algorithm is better for the "numbers" case, for which the data
sample differs in very few bits. The new code is 33% slower for that
particular case.

On average, the improvement (including the "numbers" case) is:

 compared to          qHash only          QHash
Qt 5.0 function          2.54x            1.06x
Qt 4.x function          4.34x            1.34x
Java function            2.71x            1.11x

Test machine: Sandybridge Core i7-2620M @ 2.66 GHz with turbo disabled
for the benchmarks

Change-Id: Ia80b98c0e20d785816f7a7f6ddf40b4b302c7297
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-23 01:06:34 +01: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 Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01: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
qdatetime QDateTime - Remove some benchmark tests 2013-09-23 01:14:10 +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 Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
qset Iterate over the smaller set in QSet::intersect(). 2013-06-05 09:35:42 +02:00
qstring Allow non-character codes in utf8 strings 2013-10-17 09:50:58 +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 QDateTime - Add Benchmark Tests 2013-09-20 23:45:06 +02:00