Closed dmitshur closed 8 years ago
I'm going to merge this now.
I've been testing the new version locally, and everything seems to be functional and stable, I have not caught any regressions.
There are still some TODOs scattered in the code, they are mostly about cleaning up and better organizing the code; all the functionally important and correctness-critical TODOs have been resolved by now.
I will continue to work on addressing the remaining style and code organization issues, but that shouldn't block this otherwise incredible performance and code simplification improvement PR from being merged.
I know some people have commented that Go Package Store was slow, and it truly was. After this change, it's incredibly fast, as it should be. This is all a result of simplifying the code and doing the parallel pipeline processing right. And no more gists; I was finally able to get rid of those pesky things. :) Time to :ship: it!
This is a major refactor that should preserve current behavior, but update internal code significantly.
The four main consequences are:
No more bottlenecks due to legacy architecture that prevented all operations that can be executed in parallel from being executed in parallel. Without such artificial limitations, the time to calculate Go-Package-Store output is significantly reduced.
In a sample Go workspace with 3000~ Go packages (with many, many outdated packages), the previous version of Go-Package-Store took:
The new version took:
-godeps
or-govendor
flags, previously, it would only display updates for packages that you happened to have in your GOPATH already. If a package mentioned in Godeps.json or vendor.json wasn't available in your GOPATH workspace, updates could not be presented. This restriction is lifted.repo.Updater
interface and its implementations are simplified. Its responsibility is now only to update the provided repository, not to ensure updated packages are hidden, etc. This should help with #51.The general idea behind the refactor is similar to the related project https://github.com/shurcooL/gostatus/pull/27.
Depends on https://github.com/google/go-github/pull/255 being merged to avoid data races, but they're harmless (the value under a data race is not being used), so not blocking.