From 48abb9fe0eeaf0149f0351acb00201f07e79f293 Mon Sep 17 00:00:00 2001 From: Chris Kennelly Date: Mon, 25 Mar 2024 13:16:00 -0700 Subject: Record sizeof(key_type), sizeof(value_type) in hashtable profiles. This can identify situations where flat_hash_* is suboptimal for large elements. PiperOrigin-RevId: 618937993 Change-Id: I2bde069bc3526b14ad1718ba6f50467002aeed16 --- absl/container/internal/raw_hash_set_test.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'absl/container/internal/raw_hash_set_test.cc') diff --git a/absl/container/internal/raw_hash_set_test.cc b/absl/container/internal/raw_hash_set_test.cc index f00cef8c..ca6656c8 100644 --- a/absl/container/internal/raw_hash_set_test.cc +++ b/absl/container/internal/raw_hash_set_test.cc @@ -2571,6 +2571,8 @@ TYPED_TEST_P(RawHashSamplerTest, Sample) { std::memory_order_relaxed)]++; reservations[info.max_reserve.load(std::memory_order_relaxed)]++; EXPECT_EQ(info.inline_element_size, sizeof(typename TypeParam::value_type)); + EXPECT_EQ(info.key_size, sizeof(typename TypeParam::key_type)); + EXPECT_EQ(info.value_size, sizeof(typename TypeParam::value_type)); if (soo_enabled) { EXPECT_EQ(info.soo_capacity, SooCapacity()); -- cgit v1.2.3