Commit Graph

1044 Commits

Author SHA1 Message Date
levlam
6e86faaa0f Improve factorization tests. 2022-03-20 00:01:07 +03:00
levlam
ccf2da2865 Move find_package(ABSL) under TD_WITH_ABSEIL. 2022-03-14 16:20:56 +03:00
levlam
cd21f58e7d Optimize FlatHashTable::emplace. 2022-03-14 13:25:41 +03:00
levlam
057b2d1e05 Remove EndSentinel, not allowed in C++14. 2022-03-13 23:14:18 +03:00
levlam
daef14ade1 Return NodePointer instead of iterator in find/emplace. 2022-03-12 15:27:14 +03:00
levlam
62f463b421 Use a sentinel for FlatHashTable::end(). 2022-03-12 13:26:03 +03:00
levlam
eb89f8b35f Minor include fixes. 2022-03-12 00:50:04 +03:00
levlam
254f10b885 Fix include. 2022-03-11 21:49:58 +03:00
levlam
1f38124861 Use FlatHashSet. 2022-03-11 21:38:48 +03:00
levlam
3eda5b17ac FlatHashTable: optimize find. 2022-03-11 14:10:10 +03:00
levlam
acf30d3700 Fix HashTable::operator->. 2022-03-11 13:34:36 +03:00
levlam
2413b3fd37 Add unordered_map<string, ...> benchmark. 2022-03-09 23:23:44 +03:00
levlam
7f7344c363 Add separate FlatHashSet.h. 2022-03-09 23:01:10 +03:00
levlam
eac8550ec6 Move non-template FlatHashTable functions to cpp. 2022-03-09 18:16:59 +03:00
levlam
07bb129653 Move FlatHashTable implementation to FlatHashTable.h. 2022-03-09 18:03:56 +03:00
levlam
15520c5ddd Move static functions out of FlatHashTable. 2022-03-09 17:00:22 +03:00
levlam
44b844eeeb Rename is_key_empty to is_hash_table_key_empty. 2022-03-09 16:40:50 +03:00
levlam
8b897c7c5f Move MapNode and SetNode to separate classes. 2022-03-09 16:29:47 +03:00
levlam
ea52727c21 Add FlatHashTable::create_iterator private function. 2022-03-09 15:44:14 +03:00
levlam
d8071f458e Remove now unneeded identity helper functions. 2022-03-09 15:34:56 +03:00
levlam
5cda813bd9 Move control block back to FlatHashTable itself to avoid cache line sharing between control blocks of all big tables. 2022-03-09 15:17:29 +03:00
levlam
a59e6b8ffe Add static_assert that flag in STORE_FLAG/PARSE_FLAG is bool. 2022-03-01 21:39:24 +03:00
levlam
f993bebc2f Disable FlatHashTable for release. 2022-03-01 15:16:57 +03:00
levlam
1f300c50e0 DownloadManager fixes. 2022-02-28 18:25:07 +03:00
levlam
21a71e6441 Minor improvements. 2022-02-25 16:18:23 +03:00
levlam
c631c8c356 Slightly optimize FlatHashTable::resize. 2022-02-25 14:30:02 +03:00
levlam
9590cdd8d0 Optimize erase_node, part 2. 2022-02-25 14:27:38 +03:00
levlam
03a994e198 Optimize erase_node, part 1. 2022-02-25 13:53:13 +03:00
levlam
ef14369058 Store bucket_count in FlatHashTableInner. 2022-02-25 04:04:29 +03:00
levlam
01b884858d Return the same begin() if hashtable wasn't changed. 2022-02-25 00:24:27 +03:00
levlam
a657cf6458 Use random begin() in HashTable. 2022-02-25 00:04:32 +03:00
levlam
f298d71c08 HashTable bug fixes. 2022-02-24 22:04:21 +03:00
levlam
ecb14f1bdd Minore fixes. 2022-02-24 21:38:57 +03:00
levlam
35cf57eed8 Consistently use uint32 in FlatHashTable. 2022-02-23 22:51:43 +03:00
levlam
fe06a1d4fc Fix GCC warnings. 2022-02-23 22:46:32 +03:00
levlam
e1909b018e Reduce size of an empty FlatHashTable. 2022-02-23 22:13:40 +03:00
levlam
3da16b4501 Use bucket_count() instead of nodes_.size(). 2022-02-23 18:20:25 +03:00
Arseny Smirnov
e2c7601c2b DownloadManager: draft 2022-02-23 19:34:26 +01:00
levlam
6f2a9270a3 Always try shrink after node erasure. 2022-02-23 18:05:56 +03:00
levlam
d090929249 Store end_ in iterator instead of map itself. 2022-02-23 17:41:11 +03:00
levlam
b307396628 Simplify FlatHashTable implementation. 2022-02-23 16:34:42 +03:00
levlam
73ade8cc43 Randomize hash value and optimize bucket calculation. 2022-02-23 16:27:19 +03:00
levlam
b3a784f4ba Properly clear other hashmap after move. 2022-02-23 15:58:12 +03:00
levlam
5f5205ae6c Remove unneeded return values from hashtable move-assignment operators. 2022-02-23 15:50:58 +03:00
levlam
1f12b0d8e8 Allow folly usages only if TD_TEST_FOLLY is defined. 2022-02-23 15:01:53 +03:00
levlam
c9c9a73499 Fix swap(fixed_vector) usages. 2022-02-21 05:49:59 +03:00
levlam
f0a2ccd0fb Remove value_type from SetNode. 2022-02-21 02:22:01 +03:00
levlam
9e8b2489bd Keep the first value from initializer_list. 2022-02-21 00:33:19 +03:00
levlam
77ccc13181 Add Map/SetNode::copy_from. 2022-02-20 23:03:34 +03:00
levlam
983cc2c45c Various hash table improvements. 2022-02-19 11:34:43 +03:00
levlam
94289c0c9e Fix SCOPE_EXIT redefinition. 2022-02-18 23:25:23 +03:00
levlam
ae3854d97c Various fixes. 2022-02-18 23:04:25 +03:00
levlam
b5cf85d6e2 Fix compilation error. 2022-02-18 15:15:58 +03:00
Arseny Smirnov
952ac3ed7c FlatHashMap: add MaskSse2 to benchmark 2022-02-18 00:48:33 +01:00
Arseny Smirnov
39934a7f9e FlatHashMap: sse2 support 2022-02-18 00:47:58 +01:00
Arseny Smirnov
a356cc7e3d FlatHashMap: optimizations 2022-02-18 00:30:14 +01:00
Arseny Smirnov
5ff92065bf FlatHashMap: fixes for portability 2022-02-17 20:22:46 +01:00
Arseny Smirnov
34a69e3133 FlatHashMap: add implementation with chunks 2022-02-17 19:40:18 +01:00
levlam
512c0cd3c2 Fix formatting. 2022-02-12 00:48:35 +03:00
Arseny Smirnov
a11d37dd4c FlatHashMap: fix CE 2022-02-11 18:11:17 +01:00
Arseny Smirnov
ecceb51881 FlatHashSet 2022-02-11 17:41:40 +01:00
levlam
15f27455c5 Move other big classes inside FlatHashMap to unique_ptr. 2022-02-11 19:27:32 +03:00
levlam
5b4bea1fef Add HashMap build time benchmark. 2022-02-11 14:46:30 +03:00
levlam
6ae2096d68 Fix HashSet benchmark. 2022-02-11 11:26:58 +03:00
Arseny Smirnov
1a3adc3ee7 FlatHashTable: bugfix 2022-02-10 22:44:40 +01:00
Arseny Smirnov
500c20f7ea FlatHashMap: more benchmarks 2022-02-10 22:34:01 +01:00
levlam
b71e330396 Fix tests. 2022-02-11 00:11:02 +03:00
levlam
b8ab910b81 Various improvements. 2022-02-10 23:01:28 +03:00
Arseny Smirnov
987e875520 FlatHashMap: support mem_stat->rss in memory benchmark; move memory benchmark in other folder, fix build. 2022-02-10 18:33:23 +01:00
Arseny Smirnov
6bb365567b FlatHashMap: improve memory benchmark 2022-02-10 18:29:52 +01:00
levlam
1a28bbd00c Remove redundant checks from calc_bucket. 2022-02-10 18:30:03 +03:00
Arseny Smirnov
10c59db842 FlatHashMap: simple benchmark for memory usage 2022-02-10 14:37:19 +01:00
Arseny Smirnov
f4b3a09646 FlatHashMap: shrink table if too sparse 2022-02-10 14:37:19 +01:00
levlam
9e6d106585 Minor improvements. 2022-02-10 11:55:32 +03:00
Arseny Smirnov
129d12566d FlatHashMap: add tests 2022-02-09 22:22:51 +01:00
Arseny Smirnov
8d8896d7f0 FlatHashMap: remove_if; generic td::table_remove_if 2022-02-09 22:22:51 +01:00
Arseny Smirnov
87354498e4 cmake: use SYSTEM after PUBLIC or PRIVATE in target_link_libraries to avoid error 2022-02-09 22:22:51 +01:00
levlam
967cb9e8a5 Fix compilation error. 2022-02-09 18:41:38 +03:00
levlam
22ed61e1b7 More FlatHashMap usages. 2022-02-09 17:05:27 +03:00
levlam
b403a3793d Explicitly check for empty key in FlatHashImpl::find. 2022-02-09 15:41:23 +03:00
levlam
4eacaa3ebd FlatHashMap improvements. 2022-02-09 03:08:18 +03:00
Arseny Smirnov
d5e163cd9d FlatHashMap: support initializer_list 2022-02-08 20:47:10 +01:00
Arseny Smirnov
d5db554b70 FlatHashMap: benchmark 2022-02-08 19:38:09 +01:00
Arseny Smirnov
d0cd7a8926 FlatHashMap: inline with_node usages 2022-02-08 19:38:09 +01:00
Arseny Smirnov
5d074a4b18 FlatHashMap: some optimizations 2022-02-08 19:38:09 +01:00
Arseny Smirnov
e3a5b29d20 FlatHashMap: use same code for const and non-const methods 2022-02-08 19:38:09 +01:00
levlam
b7a51bd9d5 FlatHashMap improvements. 2022-02-08 02:26:07 +03:00
levlam
5d1e50fd8d Remove wrongly used EqualT in FlatHashMap. 2022-02-08 01:06:57 +03:00
levlam
b62ced6d95 Minor improvements. 2022-02-08 00:42:53 +03:00
levlam
bcc2adeb47 Fix includes and formatting. 2022-02-08 00:04:34 +03:00
Arseny Smirnov
86bceb2972 td: replace most of std::unordered_map usages to td::FlatHashMap 2022-02-07 21:21:31 +01:00
Arseny Smirnov
088ce02832 tdutils: FlatHashMap 2022-02-07 21:21:31 +01:00
levlam
0b33522821 Improve ChainScheduler. 2022-02-03 22:01:09 +03:00
levlam
950876b496 Minor improvements. 2022-02-01 18:25:02 +03:00
Arseny Smirnov
7c9d698023 SequenceDispatcher: bugfixes 2022-02-01 17:05:23 +03:00
Arseny Smirnov
da4d6318fc SequenceDispatcher: distribute food limits to net queries in the same chain and with the same tl_constructor 2022-02-01 16:06:48 +03:00
Arseny Smirnov
24766fdad8 ChainScheduler: pass new test 2022-02-01 16:04:58 +03:00
Arseny Smirnov
b4396f18c6 ChainScheduler: tests and optimizations 2022-02-01 16:02:35 +03:00
levlam
c783115974 Fix warnings. 2022-01-31 22:00:00 +03:00
levlam
31e7447158 Disable is_emoji implementation is there is no zlib. 2022-01-31 20:20:31 +03:00