Skip to content

Cache GOROOT at init time - #717

Merged
mattfarina merged 1 commit into
Masterminds:masterfrom
heyitsanthony:cache-goroot
Apr 7, 2017
Merged

Cache GOROOT at init time#717
mattfarina merged 1 commit into
Masterminds:masterfrom
heyitsanthony:cache-goroot

Conversation

@heyitsanthony

Copy link
Copy Markdown

When GOROOT is not set as an environment variable, GetBuildContext
fetches it from 'go env GOROOT', which takes about 50ms on my machine.
This overhead can almost double the time it takes to run an update since
GetBuildContext is called relatively frequently.

Instead, read GOROOT during initialization and cache it for
GetBuildContext.

When GOROOT is not set as an environment variable, GetBuildContext
fetches it from 'go env GOROOT', which takes about 50ms on my machine.
This overhead can almost double the time it takes to run an update since
GetBuildContext is called relatively frequently.

Instead, read GOROOT during initialization and cache it for
GetBuildContext.
@mattfarina mattfarina added this to the 0.13 milestone Apr 7, 2017
@mattfarina
mattfarina merged commit da6220c into Masterminds:master Apr 7, 2017
mattfarina added a commit that referenced this pull request Apr 7, 2017
@mattfarina

Copy link
Copy Markdown
Member

@heyitsanthony thanks for the contribution!

@heyitsanthony
heyitsanthony deleted the cache-goroot branch April 8, 2017 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants