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
x/tools/cmd/guru: limit 'referrers' query to scope? #14747
Comments
I thought about this and ultimately decided no. The problem is that there are conceptually two different scopes that users care about; call them the "type checking scope" and the "pointer analysis scope". Most users want the type checking scope, as used by "referrers" and "implements" queries, to be global, since it is relatively quick to find the set of packages that might need to be type checked, and both type checking and result reporting can occur in streaming fashion (although they don't yet). But no user wants the pointer analysis scope to be global because it would make callers/callees/peers queries intolerably slow. Some users, those with very large workspaces, might want the type checking scope to be less than global, perhaps the same as the pointer analysis scope, or perhaps some independent larger set of packages, but the idea of having not one but two scope parameters in the user interface seemed terribly confusing to me. (One is already too many.) I hope that we can make the referrers and implements queries both fast and streaming, so even users with large workspaces will find them acceptable---even if they sometimes interrupt the tool before it has finishing printing all references to, say, fmt.Println. |
The primary reason I filed this issue wasn't because of performance reasons, but noise. I was interested in referrers, but only in a subset of my workspace. Instead, I got a very long list of uses I wasn't interested in. I'm not sure if this is an issue that should be addressed in guru, or the editor. Doing path-based filtering in the editor might be a close enough approximation to what I want. |
I agree that whatever we do for implements we should also do for referrers. |
Another data point: I have a Go corpus of about 250,000 packages that makes up a single GOPATH. I use that corpus for various analyses. Using |
I was surprised that Edit: I see in #14748 you have pretty heavily debated this aspect already. Just take my comment as another data point I suppose. |
+1, guru referrers is really too slow, making this feature almost useless. |
Same issue here; |
Just another data point here: my GOPATH is about 50GB of source (the vast majority of which is not Go) and referrers takes about 30 seconds. |
Currently, the 'referrers' query checks all packages in GOROOT and GOPATH. Should it optionally be possible to limit it with the
-scope
flag?/cc @alandonovan
The text was updated successfully, but these errors were encountered: