Skip to content

Commit 6c9867d

Browse files
committed
Reduce the DepNode pre-allocation ratio.
A code size of increase of 15% is overly generous. 2% is more realistic. This change reduces peak memory size by 20+ MiB on some workloads.
1 parent eab3eb3 commit 6c9867d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/dep_graph/graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ impl CurrentDepGraph {
993993
// Pre-allocate the dep node structures. We over-allocate a little so
994994
// that we hopefully don't have to re-allocate during this compilation
995995
// session.
996-
let new_node_count_estimate = (prev_graph_node_count * 115) / 100;
996+
let new_node_count_estimate = (prev_graph_node_count * 102) / 100;
997997

998998
CurrentDepGraph {
999999
data: IndexVec::with_capacity(new_node_count_estimate),

0 commit comments

Comments
 (0)