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

Find Usages of ::new slow #4222

Closed
dvtomas opened this issue Aug 4, 2019 · 1 comment · Fixed by #4757
Closed

Find Usages of ::new slow #4222

dvtomas opened this issue Aug 4, 2019 · 1 comment · Fixed by #4757
Labels
performance subsystem::type inference & name resolution Issues related to name resolution and/or type inference

Comments

@dvtomas
Copy link

dvtomas commented Aug 4, 2019

I have about a hundred constructors of various structs named new (Foo::new) in my medium sized project (about 50 000 lines split into 10 crates in a workspace). When I hit Alt-F7 to find usages of some of thosenew, it often takes half a minute to perform the search on my Core i5, turning this very fundamental action into something almost unusable. Less common names resolve much faster.

@mchernyavsky mchernyavsky added performance subsystem::type inference & name resolution Issues related to name resolution and/or type inference labels Aug 4, 2019
@vlad20012
Copy link
Member

vlad20012 commented Aug 5, 2019

Yes, it's known issue. Seems like new name is so widespread in the Rust ecosystem that our algorithms stop working =D
I think we should make a search by struct/enum name in the case of associated items, but now this approach will work worse because of re-exports that we don't take into account during the search.

Also, we significantly improved the performance recently, it should also affect find usages. Will be in the next release (1 week ETA)

vlad20012 added a commit that referenced this issue Dec 16, 2019
Works for e.g. functions in inherent impls or
trait impls. Greatly speeds up find usages of
`Foo::new` functions. Fixes #4222
bors bot added a commit that referenced this issue Dec 19, 2019
4757: PERF: optimize "find usages" of associated values r=vlad20012 a=vlad20012

Works for e.g. functions in inherent impls or trait impls. Greatly speeds up find usages of `Foo::new` functions. Fixes #4222

Co-authored-by: vlad20012 <beskvlad@gmail.com>
@bors bors bot closed this as completed in 16652e6 Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance subsystem::type inference & name resolution Issues related to name resolution and/or type inference
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants