qt5base-lts/tests/auto/corelib/tools
Lars Knoll f14559790b Change qHashBits to use MurmurHash2
The old implementation was either using CRC32 on modern processors
or a trivial, but rather slow implementation.

We can't continue with CRC32, as that implementation can only
give us 32bit hashes, where we now need to support 64bit in Qt 6.

Change the implementation to use MurmurHash, as public domain
implementation that is both very fast and leads to well distributed hashes.

This hash function is about as fast as the SSE optimized CRC32 implementation
but works everywhere and gives us 64 bit hash values.

Here are some numbers (time for 10M hashes):

                                         14 char     16 char
                                         QByteArray  QString  float
old qHash (non CRC32)                    127ms       134ms    48ms
old qHash (using SSE CRC32 instructions  60ms        62ms     46ms
new qHash                                52ms        43ms     46ms

Unfortunately MurmurHash is not safe against hash table DoS attacks, as
potential hash collisions are indepenent of the seed. This will get
addressed in followup commit, where we use SipHash or an SSE optimized
AES based hashing algorithm that does not have those issues.

Change-Id: I4fbc0ac299215b6db78c7a0a2a1d7689b0ea848b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:03:45 +02:00
..
collections Change qHash() to work with size_t instead of uint 2020-04-09 20:03:25 +02:00
containerapisymmetry Change qHash() to work with size_t instead of uint 2020-04-09 20:03:25 +02:00
qalgorithms Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qarraydata Merge remote-tracking branch 'origin/dev' into merge-dev 2020-01-24 13:17:33 +01:00
qbitarray Merge remote-tracking branch 'origin/dev' into merge-dev 2020-01-24 13:17:33 +01:00
qcache Change qHash() to work with size_t instead of uint 2020-04-09 20:03:25 +02:00
qcommandlineparser Post merge fixes 2019-11-25 14:53:27 +00:00
qcontiguouscache Extend QContiguousCache to use qsizetype for size and indices 2020-03-14 10:36:47 +01:00
qcryptographichash QCryptographicHash: Add a static method to retrieve hash length 2018-04-10 12:17:43 +00:00
qeasingcurve Merge remote-tracking branch 'origin/5.15' into dev 2020-04-08 20:11:39 +02:00
qexplicitlyshareddatapointer Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qflatmap Long live QFlatMap! 2020-01-02 15:28:20 +01:00
qfreelist Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qhash Implement emplace() for QHash and QMultiHash 2020-04-09 20:03:32 +02:00
qhashfunctions Change qHashBits to use MurmurHash2 2020-04-09 20:03:45 +02:00
qline Remove the remaining usages of deprecated APIs of qtbase 2019-08-01 06:48:27 +02:00
qlinkedlist Merge remote-tracking branch 'origin/5.15' into dev 2020-03-11 15:34:21 +01:00
qmacautoreleasepool Add missing dependencies for tst_qmacautoreleasepool 2018-08-29 02:47:45 +00:00
qmakearray Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qmap Merge remote-tracking branch 'origin/5.15' into dev 2020-03-04 14:39:18 +00:00
qmargins Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qmessageauthenticationcode Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qoffsetstringarray Don't enforce C++11 2020-01-30 09:29:08 +01:00
qpair Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qpoint Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qpointf Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qqueue Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qrect Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qringbuffer Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qscopedpointer Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qscopedvaluerollback Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qscopeguard Merge remote-tracking branch 'origin/5.15' into dev 2020-04-08 20:11:39 +02:00
qset Change qHash() to work with size_t instead of uint 2020-04-09 20:03:25 +02:00
qsharedpointer Cleanup code where we mixed QHash and QMultiHash iterator code 2020-02-03 17:43:30 +01:00
qsize Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qsizef Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qstl Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qtaggedpointer Change QTaggedPointer API to be more similar to other smart pointers in Qt 2020-03-19 19:01:31 +01:00
qtimeline Merge remote-tracking branch 'origin/dev' into wip/cmake 2020-01-29 16:57:27 +01:00
qvarlengtharray Use qsizetype for size related methods in QVarlengthArray 2020-03-14 10:36:56 +01:00
qvector Change qHash() to work with size_t instead of uint 2020-04-09 20:03:25 +02:00
qversionnumber Core: Provide comparison functions for QTypeRevision 2020-02-07 19:19:50 +01:00
.prev_CMakeLists.txt Introduce helper class QTaggedPointer 2020-03-17 10:01:04 +01:00
CMakeLists.txt Introduce helper class QTaggedPointer 2020-03-17 10:01:04 +01:00
tools.pro Introduce helper class QTaggedPointer 2020-03-17 10:01:04 +01:00