Go Analyzer: Performance improvements, new issues, and more!

We’ve been working hard on improving the Go Analyzer over the last couple of months, and I’m excited to announce some exciting new things today! These updates are available immediately on DeepSource Cloud and DeepSource Enterprise Server v3.13.9.

Performance Improvements

Static analysis of pull requests is now up to 70% faster for medium to large-sized repositories and up to 30% faster on average for small-sized repositories. :sparkles:

How? We’ve enabled the Go Analyzer to run a partial analysis for modules to achieve this. As you know, DeepSource only shows issues that you’re newly introducing in each pull request. However, since we require the complete type information for all modules in a repository, we still had to process all the files regardless of the changeset and then remove issues from non-changeset files post hoc. With this change, we parse the imports of each file that needs to be analyzed, figure out the packages they depend on, build the complete import graph, and only consider the packages present in the import graph for analysis.

To add a cherry on top, Go 1.19 introduces several compiler-caching improvements. This has contributed to our overall analysis being noticeably faster for all analysis runs, including complete analysis on the entire repository.

New in Autofix

We’ve added Autofix for ten issues in this release, increasing the coverage of Autofix to 135+ issues.

See all issues with new Autofix

New Issues

We’ve added 42 new issues to the Analyzer this year, bringing the total issue count to 350+, the highest in the industry for Go static analysis tools.

These new issues span security, anti-patterns, bug risks, performance, and style. Expand these categories below to see the list of issues.

Security
Anti-patterns
Bug risks
Style
Performance

If you’re using DeepSource for your Go projects, you’re already on the latest version and should start seeing considerable improvement in analysis times and more issues. We’re excited to ship this release and would love to hear from you! Let us know your feedback in the comments!

2 Likes