This CL contains two optimizations that were measured together. 1) InsertMiss (i. e. successful insert) optimization: The idea that in case there is no kDeleted, we already know 99% of the information. So we are finding the position to insert with 2 asm instructions (or 3 in case of ARM or portable) and passing that as a hint into `prepare_insert`. `prepare_insert` is out of the line in order to minimize effect on InsertHit (the most important case). `prepare_insert` may use the hint in case we still have growth and no kDeleted is guaranteed. In case of kDeleted, we still call `find_first_non_full` in order to potentially find kDeleted slot earlier. We may consider different ways to do it faster for kDeleted later. 2) `find_first_non_full` optimization: After optimization #1 `find_first_non_full` is used: 1. during resize and copy 2. right after resize 3. during DropDeletedWithoutResize 3. in InsertMiss for tables with kDeleted In cases 1-3 the table is quite sparse. 1. After resize it is 7/16 sparse 2. During resize it is 7/16 maximum, but during first inserts it is much sparser. 3. During copy it may be up to 7/8, but at the beginning it is way sparser. 4. During DropDeletedWithoutResize it is 25/32 sparse, but at the beginning it is way sparser. The only case, where the table is not known to be sparse, with `find_first_non_full` usage is a table with deleted elements. But according to hashz, we have <3% such tables. Adding an extra branch wouldn't hurt much there. PiperOrigin-RevId: 619681885 Change-Id: Id3e2852cc6d85f6c8f90982d7aeb14799696bf39
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| btree.h | Loading commit data... | |
| btree_container.h | Loading commit data... | |
| common.h | Loading commit data... | |
| common_policy_traits.h | Loading commit data... | |
| common_policy_traits_test.cc | Loading commit data... | |
| compressed_tuple.h | Loading commit data... | |
| compressed_tuple_test.cc | Loading commit data... | |
| container_memory.h | Loading commit data... | |
| container_memory_test.cc | Loading commit data... | |
| hash_function_defaults.h | Loading commit data... | |
| hash_function_defaults_test.cc | Loading commit data... | |
| hash_generator_testing.cc | Loading commit data... | |
| hash_generator_testing.h | Loading commit data... | |
| hash_policy_testing.h | Loading commit data... | |
| hash_policy_testing_test.cc | Loading commit data... | |
| hash_policy_traits.h | Loading commit data... | |
| hash_policy_traits_test.cc | Loading commit data... | |
| hashtable_debug.h | Loading commit data... | |
| hashtable_debug_hooks.h | Loading commit data... | |
| hashtablez_sampler.cc | Loading commit data... | |
| hashtablez_sampler.h | Loading commit data... | |
| hashtablez_sampler_force_weak_definition.cc | Loading commit data... | |
| hashtablez_sampler_test.cc | Loading commit data... | |
| inlined_vector.h | Loading commit data... | |
| layout.h | Loading commit data... | |
| layout_benchmark.cc | Loading commit data... | |
| layout_test.cc | Loading commit data... | |
| node_slot_policy.h | Loading commit data... | |
| node_slot_policy_test.cc | Loading commit data... | |
| raw_hash_map.h | Loading commit data... | |
| raw_hash_set.cc | Loading commit data... | |
| raw_hash_set.h | Loading commit data... | |
| raw_hash_set_allocator_test.cc | Loading commit data... | |
| raw_hash_set_benchmark.cc | Loading commit data... | |
| raw_hash_set_probe_benchmark.cc | Loading commit data... | |
| raw_hash_set_test.cc | Loading commit data... | |
| test_allocator.h | Loading commit data... | |
| test_instance_tracker.cc | Loading commit data... | |
| test_instance_tracker.h | Loading commit data... | |
| test_instance_tracker_test.cc | Loading commit data... | |
| tracked.h | Loading commit data... | |
| unordered_map_constructor_test.h | Loading commit data... | |
| unordered_map_lookup_test.h | Loading commit data... | |
| unordered_map_members_test.h | Loading commit data... | |
| unordered_map_modifiers_test.h | Loading commit data... | |
| unordered_map_test.cc | Loading commit data... | |
| unordered_set_constructor_test.h | Loading commit data... | |
| unordered_set_lookup_test.h | Loading commit data... | |
| unordered_set_members_test.h | Loading commit data... | |
| unordered_set_modifiers_test.h | Loading commit data... | |
| unordered_set_test.cc | Loading commit data... |