-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve beats build and test time #4755
Comments
According to the last post here there is logic to determine if the packages need to be rebuilt. One test would be to modify something in the vendor dir and see if the change is picked up. |
That's awesome, on my laptop it reduced the time to compile metricbeat from 70s to 5s. In my test it also correctly detected a change in the I'm +1 to adding it to the makefile and see if we hit any weird conditions from it. Kind of surprised we didn't see this before, but the docs are kind of misleading on it:
|
I was also confused by the docs. I stumbled over it because I wanted to know why Will open a PR for further tests / discussions. |
See elastic#4755 for details.
Closing this as the -i flag was added. In Go 1.10 it actually is not needed anymore as new detection mechanisms are in place. |
Building a beat currently takes quite a bit of time because of all the dependencies. The reasons is that Golang rebuilds all packages every time. The
-i
flag can be used to save the packages under$GOPATH/pkg
so they can be later reused.Here the output of a few example commands I used:
First the
pkg
directory is removed and thengo build
is run twice as an example, then once with-i
and then again twice with the prebuilt packages. The difference is ~45s which is quite a lot. The-i
flag also has quite a bit of an effect when running unit tests.I was thinking we could add this to our Makefile but the part I worry about is how Golang will invalidate existing package files (or not).
The text was updated successfully, but these errors were encountered: