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

In resolve, re-use ribs to avoid allocation #4948

Closed
catamorphism opened this issue Feb 15, 2013 · 3 comments
Closed

In resolve, re-use ribs to avoid allocation #4948

catamorphism opened this issue Feb 15, 2013 · 3 comments
Labels
A-resolve Area: Path resolution I-compiletime Issue: Problems and improvements with respect to compile times.

Comments

@catamorphism
Copy link
Contributor

As per comment in resolve::Resolver

@pnkfelix
Copy link
Member

The original fixme comment was introduced in f093d37 (in the file resolve3.rs in that commit; github does not show it for me in the commit, you need to do view file, or not use github. :)

From looking at the resolve code, it seems like we indeed push and pop rib objects in a pretty regular fashion, and may also only use it like a stack... (maybe fixing this is actually easy; I do not immediately see a case where the @Rib elements of value_ribs escape from their containing vector...)

@alexcrichton
Copy link
Member

I believe resolve has changed quite a bit since this was opened, and I think it's best to track the implementation details of resolve inside of resolve itself to make sure they stay up to date.

@nagisa
Copy link
Member

nagisa commented May 31, 2015

This issue is still relevant. That is, we still do allocations (pushes) and deallocations (pops). Maybe we should move from vector to some implementation of stack instead (not that it would decrease amount of allocations much)?

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 22, 2023
Remove comment about reusing rib allocations

Perf indicates this to not be worth the complexity

cc rust-lang#4948
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Path resolution I-compiletime Issue: Problems and improvements with respect to compile times.
Projects
None yet
Development

No branches or pull requests

4 participants