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

Investigate using go/analysis for better performance #80

Open
varungandhi-src opened this issue Mar 12, 2024 · 0 comments
Open

Investigate using go/analysis for better performance #80

varungandhi-src opened this issue Mar 12, 2024 · 0 comments

Comments

@varungandhi-src
Copy link
Contributor

varungandhi-src commented Mar 12, 2024

The go/analysis package potentially provides a way of providing indexing that:

  • Can reuse results of indexing dependencies (which could be cached by a build system), enabling incremental indexing.
  • Can utilize a more efficient encoding for serialized facts, avoiding the need to materialize full ASTs with type information for the full dependency graph, potentially addressing Reduce memory footprint for large monorepos #33

For example, the Uber NilAway tool says this about performance:

It is fast: we have designed NilAway to be fast and scalable, making it suitable for large codebases. In our measurements, we have observed less than 5% build-time overhead when NilAway is enabled. We are also constantly applying optimizations to further reduce its footprint.

[..]

Due to the sophistication of the analyses that NilAway does, NilAway caches its findings about a particular package via the Fact Mechanism from the go/analysis framework. Therefore, it is highly recommended to leverage a driver that supports modular analysis (i.e., bazel/nogo or golangci-lint, but not the standalone checker since it stores all facts in memory) for better performance on large projects. For example, see instructions below for running NilAway on your project with bazel/nogo.

One potential concern is the handling of interfaces. There are already a couple of open issues for those:

We should make sure that using go/analysis does not regress the existing functionality that we support for Find Implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant