mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-22 01:30:51 +00:00
dbms, ███████████: fixed performance issue [#CONV-2944].
This commit is contained in:
parent
bbd4109f3a
commit
c7a4df24be
@ -14,6 +14,8 @@
|
||||
#include <DB/Columns/ColumnConst.h>
|
||||
#include <DB/Functions/IFunction.h>
|
||||
|
||||
#include <stats/IntHash.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -63,13 +65,8 @@ struct IntHash32Impl
|
||||
|
||||
static UInt32 apply(UInt64 x)
|
||||
{
|
||||
x = (~x) + (x << 18);
|
||||
x = x ^ ((x >> 31) | (x << 33));
|
||||
x = x * 21;
|
||||
x = x ^ ((x >> 11) | (x << 53));
|
||||
x = x + (x << 6);
|
||||
x = x ^ ((x >> 22) | (x << 42));
|
||||
return x;
|
||||
/// seed взят из /dev/urandom.
|
||||
return intHash32<UInt64, 0x75D9543DE018BF45ULL>(x);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include <Yandex/optimization.h>
|
||||
|
||||
#include <stats/IntHash.h>
|
||||
|
||||
#include <DB/Core/Types.h>
|
||||
|
||||
|
||||
@ -42,13 +44,7 @@ template <> struct default_hash<UInt64>
|
||||
{
|
||||
size_t operator() (UInt64 key) const
|
||||
{
|
||||
key = (~key) + (key << 18);
|
||||
key = key ^ ((key >> 31) | (key << 33));
|
||||
key = key * 21;
|
||||
key = key ^ ((key >> 11) | (key << 53));
|
||||
key = key + (key << 6);
|
||||
key = key ^ ((key >> 22) | (key << 42));
|
||||
return key;
|
||||
return intHash32<UInt64, 0>(key);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user