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

internal: Reduce memory consumption by not merging trait_impls_in_deps results #14716

Merged
merged 1 commit into from
May 2, 2023

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented May 2, 2023

Closes #9167

We effectively keep a lot of copies of TraitImpl results in memory by merging them into the result of this query. This wastes a lot of memory unnecessarily. The change here brings memory usage of self down by 50mb (at a slight cost of trait solving unfortunately, though I'm hopeful it was just noice)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 2, 2023
@Veykril
Copy link
Member Author

Veykril commented May 2, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented May 2, 2023

📌 Commit 3fdff0a has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented May 2, 2023

⌛ Testing commit 3fdff0a with merge cffc402...

@Veykril Veykril changed the title Don't merge trait_impls_in_deps results internal: Reduce memory consumption by not merging trait_impls_in_deps results May 2, 2023
@bors
Copy link
Collaborator

bors commented May 2, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing cffc402 to master...

@bors bors merged commit cffc402 into rust-lang:master May 2, 2023
@lnicola
Copy link
Member

lnicola commented May 2, 2023

Yeah, it might be ~1s slower, but it's probably worth it for a 59 MB win.

@Veykril Veykril deleted the trait-deps-query branch May 2, 2023 12:35
@Veykril
Copy link
Member Author

Veykril commented May 2, 2023

Definitely, and itll save a lot more once IDE features are used. (This query repeatedly goes up to 200mb when im working on r-a for a bit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TraitImplsInDepsQuery uses a lot of memory
4 participants