|
proxygen
|
#include <folly/AtomicUnorderedMap.h>#include <memory>#include <thread>#include <unordered_map>#include <folly/Benchmark.h>#include <folly/portability/GFlags.h>#include <folly/portability/GTest.h>#include <folly/portability/Semaphore.h>#include <folly/test/DeterministicSchedule.h>Go to the source code of this file.
Classes | |
| struct | non_atomic< T > |
| struct | PairHash |
Typedefs | |
| template<typename Key , typename Value , typename IndexType , template< typename > class Atom = std::atomic, typename Allocator = std::allocator<char>> | |
| using | UIM = AtomicUnorderedInsertMap< Key, Value, std::hash< Key >, std::equal_to< Key >,(boost::has_trivial_destructor< Key >::value &&boost::has_trivial_destructor< Value >::value), Atom, IndexType, Allocator > |
| using | IndexTypesToTest = ::testing::Types< uint16_t, uint32_t, uint64_t > |
Functions | |
| TYPED_TEST_CASE (AtomicUnorderedInsertMapTest, IndexTypesToTest) | |
| TYPED_TEST (AtomicUnorderedInsertMapTest, basic) | |
| TEST (AtomicUnorderedInsertMap, load_factor) | |
| TEST (AtomicUnorderedInsertMap, capacity_exceeded) | |
| TYPED_TEST (AtomicUnorderedInsertMapTest, value_mutation) | |
| TEST (UnorderedInsertMap, value_mutation) | |
| TEST (AtomicUnorderedInsertMap, DISABLED_mega_map) | |
| BENCHMARK (lookup_int_int_hit, iters) | |
| void | contendedRW (size_t itersPerThread, size_t capacity, size_t numThreads, size_t readsPerWrite) |
| BENCHMARK_DRAW_LINE () | |
| BENCHMARK (std_map) | |
| BENCHMARK (atomic_fast_map) | |
| BENCHMARK (fast_map) | |
| BENCHMARK (atomic_fast_map_64) | |
| BENCHMARK (fast_map_64) | |
| int | main (int argc, char **argv) |
| using IndexTypesToTest = ::testing::Types<uint16_t, uint32_t, uint64_t> |
Definition at line 125 of file AtomicUnorderedMapTest.cpp.
| using UIM = AtomicUnorderedInsertMap< Key, Value, std::hash<Key>, std::equal_to<Key>, (boost::has_trivial_destructor<Key>::value && boost::has_trivial_destructor<Value>::value), Atom, IndexType, Allocator> |
Definition at line 116 of file AtomicUnorderedMapTest.cpp.
| BENCHMARK | ( | lookup_int_int_hit | , |
| iters | |||
| ) |
Definition at line 217 of file AtomicUnorderedMapTest.cpp.
References BENCHMARK_SUSPEND, EXPECT_EQ, EXPECT_TRUE, i, k, and ptr.
| BENCHMARK | ( | std_map | ) |
Definition at line 353 of file AtomicUnorderedMapTest.cpp.
References a, folly::doNotOptimizeAway(), i, and m.
| BENCHMARK | ( | atomic_fast_map | ) |
Definition at line 366 of file AtomicUnorderedMapTest.cpp.
References a, folly::doNotOptimizeAway(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find(), i, and m.
| BENCHMARK | ( | fast_map | ) |
Definition at line 378 of file AtomicUnorderedMapTest.cpp.
References a, folly::doNotOptimizeAway(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find(), i, and m.
| BENCHMARK | ( | atomic_fast_map_64 | ) |
Definition at line 390 of file AtomicUnorderedMapTest.cpp.
References a, folly::doNotOptimizeAway(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find(), i, and m.
| BENCHMARK | ( | fast_map_64 | ) |
Definition at line 402 of file AtomicUnorderedMapTest.cpp.
References a, folly::doNotOptimizeAway(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find(), i, and m.
| BENCHMARK_DRAW_LINE | ( | ) |
| void contendedRW | ( | size_t | itersPerThread, |
| size_t | capacity, | ||
| size_t | numThreads, | ||
| size_t | readsPerWrite | ||
| ) |
Definition at line 252 of file AtomicUnorderedMapTest.cpp.
References folly::BENCHMARK_DRAW_LINE(), BENCHMARK_NAMED_PARAM, BENCHMARK_SUSPEND, EXPECT_TRUE, folly::INFO, testing::Key(), ptr, folly::Random::rand32(), threads, and folly::fibers::yield().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 414 of file AtomicUnorderedMapTest.cpp.
References testing::InitGoogleTest(), RUN_ALL_TESTS(), and folly::runBenchmarksOnFlag().
| TEST | ( | AtomicUnorderedInsertMap | , |
| load_factor | |||
| ) |
Definition at line 156 of file AtomicUnorderedMapTest.cpp.
References folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), f, i, and m.
| TEST | ( | AtomicUnorderedInsertMap | , |
| capacity_exceeded | |||
| ) |
Definition at line 166 of file AtomicUnorderedMapTest.cpp.
References folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), EXPECT_THROW, f, i, and m.
| TEST | ( | UnorderedInsertMap | , |
| value_mutation | |||
| ) |
Definition at line 188 of file AtomicUnorderedMapTest.cpp.
References folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), EXPECT_EQ, folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find(), i, m, and uint32_t.
| TEST | ( | AtomicUnorderedInsertMap | , |
| DISABLED_mega_map | |||
| ) |
Definition at line 201 of file AtomicUnorderedMapTest.cpp.
References folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::cend(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), EXPECT_EQ, EXPECT_TRUE, folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find(), and i.
| TYPED_TEST | ( | AtomicUnorderedInsertMapTest | , |
| basic | |||
| ) |
Definition at line 128 of file AtomicUnorderedMapTest.cpp.
References a, b, EXPECT_EQ, EXPECT_TRUE, m, and string.
| TYPED_TEST | ( | AtomicUnorderedInsertMapTest | , |
| value_mutation | |||
| ) |
Definition at line 178 of file AtomicUnorderedMapTest.cpp.
References folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::emplace(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find(), i, and m.
| TYPED_TEST_CASE | ( | AtomicUnorderedInsertMapTest | , |
| IndexTypesToTest | |||
| ) |