From 5d8fc9192245f0ea67094af57399d7931d6bd53f Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 23 Nov 2020 17:05:17 -0800 Subject: Export of internal Abseil changes -- fcedaa5714efab8738446fa21620b827a40a3458 by Derek Mauro : Uses Wyhash in the implementation of absl::Hash for hashing sequences of more than 16 bytes on some platforms. Due to the per-process randomization of the seed used by absl::Hash, users should not notice this change, other than possibly getting better performance. This change only affects platforms where absl::uint128 is implemented with an intrinsic (and where sizeof(size_t)==8) since Wyhash relies on fast 128-bit multiplication for speed. PiperOrigin-RevId: 343956735 -- 085e108c760084f19caa21dbeb2118de2be3f8f0 by Abseil Team : Internal change for cord ring PiperOrigin-RevId: 343919274 -- 4c333278ad14d6692f203074b902506008ad624a by Jorg Brown : Minimize strings_internal::StringConstant further, by removing the need for the compiler to instantiate a compile-time class function. PiperOrigin-RevId: 343878568 -- 71c3c8c7b7821b67997e3d5345aaec67f93f266f by Abseil Team : Internal change PiperOrigin-RevId: 343838259 GitOrigin-RevId: fcedaa5714efab8738446fa21620b827a40a3458 Change-Id: Ifb91895a82d11e743acd42fe97ab7fb70712b7df --- absl/hash/BUILD.bazel | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'absl/hash/BUILD.bazel') diff --git a/absl/hash/BUILD.bazel b/absl/hash/BUILD.bazel index 5b1e2d01..40c8f207 100644 --- a/absl/hash/BUILD.bazel +++ b/absl/hash/BUILD.bazel @@ -37,6 +37,7 @@ cc_library( linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":city", + ":wyhash", "//absl/base:core_headers", "//absl/base:endian", "//absl/container:fixed_array", @@ -120,3 +121,30 @@ cc_test( "@com_google_googletest//:gtest_main", ], ) + +cc_library( + name = "wyhash", + srcs = ["internal/wyhash.cc"], + hdrs = ["internal/wyhash.h"], + copts = ABSL_DEFAULT_COPTS, + linkopts = ABSL_DEFAULT_LINKOPTS, + visibility = ["//visibility:private"], + deps = [ + "//absl/base:config", + "//absl/base:endian", + "//absl/numeric:int128", + ], +) + +cc_test( + name = "wyhash_test", + srcs = ["internal/wyhash_test.cc"], + copts = ABSL_TEST_COPTS, + linkopts = ABSL_DEFAULT_LINKOPTS, + visibility = ["//visibility:private"], + deps = [ + ":wyhash", + "//absl/strings", + "@com_google_googletest//:gtest_main", + ], +) -- cgit v1.2.3