Lines Matching refs:size_t
58 explicit HashTableBenchmark(HashTableImpl<size_t, std::string>* impl, in HashTableBenchmark() argument
59 const size_t sec = 10, in HashTableBenchmark()
60 const size_t nthread_write = 1, in HashTableBenchmark()
61 const size_t nthread_read = 1, in HashTableBenchmark()
62 const size_t nthread_erase = 1) in HashTableBenchmark()
101 size_t k = insert_key_++; in RunWrite()
113 size_t k = rgen.Next() % max_prepop_key; in RunRead()
123 size_t k = erase_key_++; in RunErase()
132 void StartThreads(const size_t n, void (*fn)(void*)) { in StartThreads()
134 for (size_t i = 0; i < n; ++i) { in StartThreads()
141 for (size_t i = 0; i < max_prepop_key; ++i) { in Prepop()
148 for (size_t i = 0; i < 10 * max_prepop_key; ++i) { in Prepop()
175 HashTableImpl<size_t, std::string>* impl_; // Implementation to test
176 const size_t sec_; // Test time
177 const size_t max_prepop_key = 1ULL * 1024 * 1024; // Max prepop key
178 std::atomic<size_t> insert_key_; // Last inserted key
179 std::atomic<size_t> erase_key_; // Erase key
180 std::atomic<size_t> ninserts_; // Number of inserts
181 std::atomic<size_t> nreads_; // Number of reads
182 std::atomic<size_t> nerases_; // Number of erases
183 std::atomic<size_t> nerases_failed_; // Number of erases failed
190 class SimpleImpl : public HashTableImpl<size_t, string> {
192 bool Insert(const size_t& key, const string& val) override { in Insert()
198 bool Erase(const size_t& key) override { in Erase()
208 bool Lookup(const size_t& key, string* val) override { in Lookup()
219 std::unordered_map<size_t, string> map_;
226 class GranularLockImpl : public HashTableImpl<size_t, string> {
228 bool Insert(const size_t& key, const string& val) override { in Insert()
233 bool Erase(const size_t& key) override { in Erase()
238 bool Lookup(const size_t& key, string* val) override { in Lookup()
251 explicit Node(const size_t key, const string& val) : key_(key), val_(val) {} in Node()
253 size_t key_ = 0;