Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the `DepNode` pre-allocation ratio. #59626

merged 1 commit into from Apr 15, 2019
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

@@ -992,8 +992,9 @@ impl CurrentDepGraph {

// Pre-allocate the dep node structures. We over-allocate a little so
// that we hopefully don't have to re-allocate during this compilation
// session.
let new_node_count_estimate = (prev_graph_node_count * 115) / 100;
// session. The over-allocation is 2% plus a small constant to account
// for the fact that in very small crates 2% might not be enough.
let new_node_count_estimate = (prev_graph_node_count * 102) / 100 + 200;

CurrentDepGraph {
data: IndexVec::with_capacity(new_node_count_estimate),
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.