Commit cbbf303
authored
[libc++] Optimize __hash_table copy constructors and assignment (#151951)
```
----------------------------------------------------------------------------------------------------------------------
Benchmark old new
----------------------------------------------------------------------------------------------------------------------
std::unordered_set<int>::ctor(const&)/0 15.4 ns 14.6 ns
std::unordered_set<int>::ctor(const&)/32 686 ns 322 ns
std::unordered_set<int>::ctor(const&)/1024 35839 ns 21490 ns
std::unordered_set<int>::ctor(const&)/8192 385790 ns 280270 ns
std::unordered_set<int>::operator=(const&) (into cleared Container)/0 15.1 ns 15.9 ns
std::unordered_set<int>::operator=(const&) (into cleared Container)/32 1077 ns 333 ns
std::unordered_set<int>::operator=(const&) (into cleared Container)/1024 31296 ns 9984 ns
std::unordered_set<int>::operator=(const&) (into cleared Container)/8192 266776 ns 109418 ns
std::unordered_set<int>::operator=(const&) (into partially populated Container)/0 15.1 ns 16.3 ns
std::unordered_set<int>::operator=(const&) (into partially populated Container)/32 962 ns 320 ns
std::unordered_set<int>::operator=(const&) (into partially populated Container)/1024 31713 ns 10128 ns
std::unordered_set<int>::operator=(const&) (into partially populated Container)/8192 266113 ns 108525 ns
std::unordered_set<int>::operator=(const&) (into populated Container)/0 0.990 ns 2.03 ns
std::unordered_set<int>::operator=(const&) (into populated Container)/32 963 ns 263 ns
std::unordered_set<int>::operator=(const&) (into populated Container)/1024 27600 ns 7793 ns
std::unordered_set<int>::operator=(const&) (into populated Container)/8192 235295 ns 66248 ns
std::unordered_set<std::string>::ctor(const&)/0 16.0 ns 15.0 ns
std::unordered_set<std::string>::ctor(const&)/32 2950 ns 1277 ns
std::unordered_set<std::string>::ctor(const&)/1024 246935 ns 73762 ns
std::unordered_set<std::string>::ctor(const&)/8192 3310895 ns 2468608 ns
std::unordered_set<std::string>::operator=(const&) (into cleared Container)/0 16.1 ns 15.8 ns
std::unordered_set<std::string>::operator=(const&) (into cleared Container)/32 5856 ns 1039 ns
std::unordered_set<std::string>::operator=(const&) (into cleared Container)/1024 170436 ns 74836 ns
std::unordered_set<std::string>::operator=(const&) (into cleared Container)/8192 1574235 ns 1096891 ns
std::unordered_set<std::string>::operator=(const&) (into partially populated Container)/0 16.0 ns 16.3 ns
std::unordered_set<std::string>::operator=(const&) (into partially populated Container)/32 5571 ns 1064 ns
std::unordered_set<std::string>::operator=(const&) (into partially populated Container)/1024 199220 ns 75462 ns
std::unordered_set<std::string>::operator=(const&) (into partially populated Container)/8192 1552465 ns 1116094 ns
std::unordered_set<std::string>::operator=(const&) (into populated Container)/0 1.70 ns 2.14 ns
std::unordered_set<std::string>::operator=(const&) (into populated Container)/32 2562 ns 645 ns
std::unordered_set<std::string>::operator=(const&) (into populated Container)/1024 228608 ns 39100 ns
std::unordered_set<std::string>::operator=(const&) (into populated Container)/8192 2013723 ns 390401 ns
```
Fixes #776571 parent b9e33fd commit cbbf303
File tree
16 files changed
+2708
-1253
lines changed- libcxx
- docs/ReleaseNotes
- include
- test/std/containers/unord
- unord.map/unord.map.cnstr
- unord.multimap/unord.multimap.cnstr
- unord.multiset/unord.multiset.cnstr
- unord.set/unord.set.cnstr
16 files changed
+2708
-1253
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
700 | 701 | | |
701 | 702 | | |
702 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
703 | 736 | | |
704 | 737 | | |
705 | 738 | | |
| |||
1048 | 1081 | | |
1049 | 1082 | | |
1050 | 1083 | | |
1051 | | - | |
| 1084 | + | |
1052 | 1085 | | |
1053 | | - | |
1054 | | - | |
| 1086 | + | |
| 1087 | + | |
1055 | 1088 | | |
1056 | | - | |
| 1089 | + | |
1057 | 1090 | | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1061 | 1107 | | |
1062 | 1108 | | |
1063 | 1109 | | |
| |||
1131 | 1177 | | |
1132 | 1178 | | |
1133 | 1179 | | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1141 | 1207 | | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1142 | 1249 | | |
1143 | 1250 | | |
1144 | 1251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | | - | |
| 1049 | + | |
1050 | 1050 | | |
1051 | 1051 | | |
1052 | | - | |
| 1052 | + | |
| 1053 | + | |
1053 | 1054 | | |
1054 | 1055 | | |
1055 | 1056 | | |
| |||
1099 | 1100 | | |
1100 | 1101 | | |
1101 | 1102 | | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
| 1103 | + | |
1117 | 1104 | | |
1118 | 1105 | | |
1119 | | - | |
| 1106 | + | |
1120 | 1107 | | |
1121 | 1108 | | |
1122 | 1109 | | |
| |||
1563 | 1550 | | |
1564 | 1551 | | |
1565 | 1552 | | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | 1553 | | |
1573 | 1554 | | |
1574 | 1555 | | |
| |||
1578 | 1559 | | |
1579 | 1560 | | |
1580 | 1561 | | |
1581 | | - | |
1582 | | - | |
1583 | | - | |
1584 | | - | |
1585 | | - | |
1586 | 1562 | | |
1587 | 1563 | | |
1588 | 1564 | | |
| |||
1618 | 1594 | | |
1619 | 1595 | | |
1620 | 1596 | | |
1621 | | - | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
1625 | | - | |
1626 | | - | |
1627 | | - | |
1628 | | - | |
1629 | 1597 | | |
1630 | 1598 | | |
1631 | 1599 | | |
| |||
1852 | 1820 | | |
1853 | 1821 | | |
1854 | 1822 | | |
1855 | | - | |
| 1823 | + | |
1856 | 1824 | | |
1857 | 1825 | | |
1858 | 1826 | | |
1859 | | - | |
| 1827 | + | |
1860 | 1828 | | |
1861 | 1829 | | |
1862 | 1830 | | |
| |||
1906 | 1874 | | |
1907 | 1875 | | |
1908 | 1876 | | |
1909 | | - | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | | - | |
1921 | | - | |
1922 | | - | |
1923 | | - | |
| 1877 | + | |
1924 | 1878 | | |
1925 | 1879 | | |
1926 | | - | |
| 1880 | + | |
1927 | 1881 | | |
1928 | 1882 | | |
1929 | 1883 | | |
| |||
2315 | 2269 | | |
2316 | 2270 | | |
2317 | 2271 | | |
2318 | | - | |
2319 | | - | |
2320 | | - | |
2321 | | - | |
2322 | | - | |
2323 | | - | |
2324 | | - | |
2325 | 2272 | | |
2326 | 2273 | | |
2327 | 2274 | | |
| |||
2332 | 2279 | | |
2333 | 2280 | | |
2334 | 2281 | | |
2335 | | - | |
2336 | | - | |
2337 | | - | |
2338 | | - | |
2339 | | - | |
2340 | 2282 | | |
2341 | 2283 | | |
2342 | 2284 | | |
| |||
2373 | 2315 | | |
2374 | 2316 | | |
2375 | 2317 | | |
2376 | | - | |
2377 | | - | |
2378 | | - | |
2379 | | - | |
2380 | | - | |
2381 | | - | |
2382 | | - | |
2383 | | - | |
2384 | 2318 | | |
2385 | 2319 | | |
2386 | 2320 | | |
| |||
0 commit comments