Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

main: optimise "runtime" steps #80

Merged
merged 1 commit into from
Aug 27, 2019
Merged

main: optimise "runtime" steps #80

merged 1 commit into from
Aug 27, 2019

Conversation

myitcv
Copy link
Owner

@myitcv myitcv commented Aug 26, 2019

gobin maintains binaries in its own cache. The key for a cache entry is
a function of main package path, version and build tags. Assuming nobody
tampers with the build cache (making it readonly is the subject of #5),
then we need only install to the cache entry if a file does not already
exist.

Also, optimise go list calls by using -find; we don't care for the
dependencies in these steps.

No change in tests because their should be no change in behaviour.

With some incredibly unscientific timing tests on my machine, this
reduces the time taken for "gobin -run github.com/myitcv/gobin -help"
from 0.636s to 0.246s. "gobin -help" times at 0.070s which means ~0.176s
of gobin "overhead".

@myitcv myitcv force-pushed the optimise_run branch 2 times, most recently from 3e771e7 to 7ba740e Compare August 26, 2019 18:20
@myitcv myitcv requested a review from mvdan August 26, 2019 18:20
Copy link
Collaborator

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, their->there in the commit message.

@myitcv myitcv force-pushed the optimise_run branch 3 times, most recently from 9f0182e to 9b85e55 Compare August 27, 2019 10:51
gobin maintains binaries in its own cache. The key for a cache entry is
a function of main package path, version and build tags. Assuming nobody
tampers with the build cache (making it readonly is the subject of #5),
then we need only install to the cache entry if a file does not already
exist.

Also, optimise go list calls by using -find; we don't care for the
dependencies in these steps.

No change in tests because there should be no change in behaviour.

With some incredibly unscientific timing tests on my machine, this
reduces the time taken for "gobin -run github.com/myitcv/gobin -help"
from 0.636s to 0.246s. "gobin -help" times at 0.070s which means ~0.176s
of gobin "overhead".
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants