Skip to content

Instantly share code, notes, and snippets.

@dmitshur
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitshur/81f1e59bb0db7febff94 to your computer and use it in GitHub Desktop.
Save dmitshur/81f1e59bb0db7febff94 to your computer and use it in GitHub Desktop.
Fastest way to go get -u, and how godep handles revisions that don't exist.

go get

  • Benchmark three ways to get/update (from scratch) the same 17 Go packages contained in a single git repo.
go get -d -u github.com/shurcooL/go/cmd/gocd
go get -d -u github.com/shurcooL/go/cmd/table
go get -d -u github.com/shurcooL/go/exp/11
go get -d -u github.com/shurcooL/go/exp/12
go get -d -u github.com/shurcooL/go/exp/13
go get -d -u github.com/shurcooL/go/exp/14
go get -d -u github.com/shurcooL/go/exp/15
go get -d -u github.com/shurcooL/go/gopath_util
go get -d -u github.com/shurcooL/go/html_table
go get -d -u github.com/shurcooL/go/html_to_markdown
go get -d -u github.com/shurcooL/go/path
go get -d -u github.com/shurcooL/go/pipe_util
go get -d -u github.com/shurcooL/go/time_util
go get -d -u github.com/shurcooL/go/trash
go get -d -u github.com/shurcooL/go/u/u1
go get -d -u github.com/shurcooL/go/u/u2
go get -d -u github.com/shurcooL/go/vcs

43.981s
go get -d -u github.com/shurcooL/go/cmd/gocd github.com/shurcooL/go/cmd/table github.com/shurcooL/go/exp/11 github.com/shurcooL/go/exp/12 github.com/shurcooL/go/exp/13 github.com/shurcooL/go/exp/14 github.com/shurcooL/go/exp/15 github.com/shurcooL/go/gopath_util github.com/shurcooL/go/html_table github.com/shurcooL/go/html_to_markdown github.com/shurcooL/go/path github.com/shurcooL/go/pipe_util github.com/shurcooL/go/time_util github.com/shurcooL/go/trash github.com/shurcooL/go/u/u1 github.com/shurcooL/go/u/u2 github.com/shurcooL/go/vcs

15.313s
go get -d -u github.com/shurcooL/go/...

15.234s

Conclusion

If you want the fastest way to get/update a lot of packages, use 1 instance of go get instead of many. There is no speedup when using the github.com/user/repo/... notation.

godep

  • Find out what happens if Godeps specifies a missing revision (imagine newer remote version).

It fails with exit code 1.

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