Commit a21e95e
committed
Auto merge of #137563 - FractalFir:dep_graph_cap, r=<try>
[Perf experiment] Changed TaskDeps to start with preallocated with 1024 capacity
This is a tiny change that makes `TaskDeps::read_set` start preallocated with capacity for 1024 elements(4096 bytes).
Somewhat annoyingly, `HashSet::with_capacity` requires the hasher to implement `RandomState`. Since `FxHash` does not implement `RandomState`, I had to use `HashSet::with_capacity_and_hasher`, which required re-exporting `FxBuildHasher` in `rustc_data_structures`.
From local profiling, it looks like `TaskDeps::read_set` is one of the most-often resized hash-sets in `rustc`.
Local perf runs indicate this is a small perf improvement(without any regressions). There is also no significant RSS increase(the RSS changes are noisy and cancel themselves out almost entirely).
Still, since the local and CI results can differ, I'll do a CI perf run before this PR can be reviewed.
`@bors` try `@rust-timer` queue1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1299 | 1299 | | |
1300 | 1300 | | |
1301 | 1301 | | |
1302 | | - | |
| 1302 | + | |
1303 | 1303 | | |
1304 | 1304 | | |
1305 | 1305 | | |
1306 | 1306 | | |
1307 | | - | |
1308 | 1307 | | |
1309 | 1308 | | |
1310 | 1309 | | |
| |||
0 commit comments