You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce and use SetCtrlInLargeTable, when we know that table is at least one group. Similarly to SetCtrlInSingleGroupTable, we can save some operations.
https://gcc.godbolt.org/z/PjrzxbMz7
We are saving ~3 microops that is not big, but still positive.
Currently the function is not used in the hot loop, but the plan is to use the function in the new implementation of `GrowToNextCapacityAndPrepareInsert`. So introducing and battle test the function in advance to simplify review iterations.
Additionally adding "PrepareInsert" to "DropDeletesWithoutResize". That is done for consistency with `GrowToNextCapacityAndPrepareInsert` and to move more code to the colder function.
Microbenchmarks:
```
name old INSTRUCTIONS/op new INSTRUCTIONS/op delta
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:16 179 ± 0% 179 ± 0% -0.29% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:32 197 ± 0% 196 ± 0% -0.66% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:64 206 ± 0% 204 ± 0% -0.68% (p=0.000 n=27+26)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:128 210 ± 0% 208 ± 0% -0.66% (p=0.000 n=25+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:256 212 ± 0% 210 ± 0% -0.67% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:512 213 ± 0% 211 ± 0% -0.74% (p=0.000 n=27+26)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:1024 213 ± 0% 211 ± 0% -0.69% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:2048 213 ± 0% 212 ± 0% -0.72% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:4096 213 ± 0% 212 ± 0% -0.69% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:8192 213 ± 0% 212 ± 0% -0.68% (p=0.000 n=27+26)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:16384 213 ± 0% 212 ± 0% -0.70% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:32768 213 ± 0% 212 ± 0% -0.70% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:65536 219 ± 1% 218 ± 0% -0.77% (p=0.000 n=27+26)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:131072 210 ± 0% 209 ± 0% -0.56% (p=0.000 n=27+25)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:262144 203 ± 0% 203 ± 0% -0.32% (p=0.000 n=27+27)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:524288 203 ± 0% 202 ± 0% -0.29% (p=0.000 n=25+26)
BM_SWISSMAP_EraseInsert_Hot<::absl::flat_hash_set, 4>/set_size:1048576 202 ± 0% 201 ± 0% -0.20% (p=0.000 n=27+27)
```
PiperOrigin-RevId: 728988087
Change-Id: Ic63f45eed3b922c4255dc36077fcf9a3d9b8b5ec
0 commit comments