Commit c6f1215
Markus Westerlind
perf(dep_graph): Avoid allocating a set on when the number reads are small
`reserve_and_rehash` takes up 1.4% of the runtime on the `packed-simd`
benchmark which I believe is due to the number of reads are very low in
many cases (see rust-lang#50565 for
instance).
This avoids allocating the set until we start allocating the `reads`
`SmallVec` but it is possible that a lower limit might be better (not
tested since the improvement will be hard to spot either way).1 parent 9381e81 commit c6f1215
1 file changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
| 1131 | + | |
1131 | 1132 | | |
1132 | 1133 | | |
1133 | 1134 | | |
1134 | | - | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1135 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1136 | 1150 | | |
1137 | 1151 | | |
1138 | 1152 | | |
| |||
1154 | 1168 | | |
1155 | 1169 | | |
1156 | 1170 | | |
| 1171 | + | |
1157 | 1172 | | |
1158 | 1173 | | |
1159 | 1174 | | |
1160 | | - | |
| 1175 | + | |
1161 | 1176 | | |
1162 | 1177 | | |
1163 | 1178 | | |
| |||
0 commit comments