File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -846,14 +846,14 @@ non_fbcode_target(
846
846
exported_deps = [
847
847
"//third-party/fmt:fmt" ,
848
848
"//xplat/folly:cpu_id" ,
849
- "//xplat/folly:hash_spooky_hash_v2" ,
850
849
"//xplat/folly:likely" ,
851
850
"//xplat/folly:portability" ,
852
851
"//xplat/folly:portability_constexpr" ,
853
852
"//xplat/folly:traits" ,
854
853
"//xplat/folly/detail:range_common" ,
855
854
"//xplat/folly/detail:range_simd" ,
856
855
"//xplat/folly/detail:range_sse42" ,
856
+ "//xplat/folly/hash:rapidhash" ,
857
857
"//xplat/folly/lang:c_string" ,
858
858
"//xplat/folly/lang:exception" ,
859
859
],
@@ -7436,7 +7436,7 @@ fbcode_target(
7436
7436
":traits" ,
7437
7437
"//folly/detail:range_common" ,
7438
7438
"//folly/detail:range_simd" ,
7439
- "//folly/hash:spooky_hash_v2 " ,
7439
+ "//folly/hash:rapidhash " ,
7440
7440
"//folly/lang:c_string" ,
7441
7441
"//folly/lang:exception" ,
7442
7442
"//folly/portability:constexpr" ,
Original file line number Diff line number Diff line change 38
38
#pragma once
39
39
40
40
#include < folly/Portability.h>
41
- #include < folly/hash/SpookyHashV2 .h>
41
+ #include < folly/hash/rapidhash .h>
42
42
#include < folly/lang/CString.h>
43
43
#include < folly/lang/Exception.h>
44
44
#include < folly/portability/Constexpr.h>
@@ -794,7 +794,7 @@ class Range {
794
794
}
795
795
796
796
// Do NOT use this function, which was left behind for backwards
797
- // compatibility. Use SpookyHashV2 instead -- it is faster, and produces
797
+ // compatibility. Use rapidhashNano instead -- it is faster, and produces
798
798
// a 64-bit hash, which means dramatically fewer collisions in large maps.
799
799
// (The above advice does not apply if you are targeting a 32-bit system.)
800
800
//
@@ -1698,7 +1698,7 @@ struct hasher<
1698
1698
// may be == without being bit-identical. size_t is less than 64
1699
1699
// bits on some platforms.
1700
1700
return static_cast <size_t >(
1701
- hash::SpookyHashV2::Hash64 (r.begin (), r.size () * sizeof (T), 0 ));
1701
+ folly::hash::rapidhashNano (r.begin (), r.size () * sizeof (T)));
1702
1702
}
1703
1703
};
1704
1704
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ fbcode_target(
47
47
headers = ["Hash.h" ],
48
48
exported_deps = [
49
49
":murmur_hash" ,
50
+ ":rapidhash" ,
50
51
":spooky_hash_v1" ,
51
52
":spooky_hash_v2" ,
52
53
"//folly:c_portability" ,
Original file line number Diff line number Diff line change 46
46
#include < folly/hash/MurmurHash.h>
47
47
#include < folly/hash/SpookyHashV1.h>
48
48
#include < folly/hash/SpookyHashV2.h>
49
+ #include < folly/hash/rapidhash.h>
49
50
#include < folly/lang/Bits.h>
50
51
51
52
namespace folly {
@@ -999,8 +1000,7 @@ struct hasher<std::string> {
999
1000
using folly_is_avalanching = std::true_type;
1000
1001
1001
1002
size_t operator ()(const std::string& key) const {
1002
- return static_cast <size_t >(
1003
- hash::SpookyHashV2::Hash64 (key.data (), key.size (), 0 ));
1003
+ return static_cast <size_t >(hash::rapidhashNano (key.data (), key.size ()));
1004
1004
}
1005
1005
};
1006
1006
template <typename K>
@@ -1011,8 +1011,7 @@ struct hasher<std::string_view> {
1011
1011
using folly_is_avalanching = std::true_type;
1012
1012
1013
1013
size_t operator ()(const std::string_view& key) const {
1014
- return static_cast <size_t >(
1015
- hash::SpookyHashV2::Hash64 (key.data (), key.size (), 0 ));
1014
+ return static_cast <size_t >(hash::rapidhashNano (key.data (), key.size ()));
1016
1015
}
1017
1016
};
1018
1017
template <typename K>
You can’t perform that action at this time.
0 commit comments