A
A
Alexander2015-10-22 19:57:27
go
Alexander, 2015-10-22 19:57:27

How to speed up the command line in GO?

go build - takes 12 seconds to process
go run main.go utils.go - takes 10 seconds to process.
A total of 22 sec. How to speed up this process on OC - Windows (8.1)?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
A
Alexander Pavlyuk, 2015-10-22
@pav5000

If you do go install on a package, then all the packages it uses will be compiled and the build will be faster. It is convenient to do this if most of the code rarely changes.

O
Oleg Tsilyurik, 2015-10-22
@Olej

How to speed up this process on OC - Windows (8.1)?

I can’t say what is there in Windows, but in Linux, under which Go was sharpened, everything flies in the air.
As a famous humorist said:
Maybe there is something wrong with you at the conservatory?

U
uvelichitel, 2015-10-22
@uvelichitel

Try -buildmode=exe

K
Kirill, 2015-10-23
@kshvakov

The problem is described here https://github.com/golang/go/issues/12228

S
SilentFl, 2015-10-23
@SilentFl

go build builds the program for you, and go run builds (into memory) + launches it.
write code - just do go run, finished - go build to get an exe file

N
Nikita, 2015-10-23
@bitver

Something you have this process too long. I have the same OS, the hardware is not the best, hard (not SSD) and startup never required more than 500ms (usually ~ 250ms), except for the first build. See what commands are executed by popular watchers from frameworks or individual implementations, maybe they will help you. Better yet, use an IDE, not a notepad with a list of commands, it's certainly good that you know the commands and know how to enter them into the console, but that's not cool -_-

U
uwl, 2015-11-23
@uwl

In addition to the first answer from Alexander Pavlyuk
Install everything in the current directory.
go get ./...
When working with vendor(glide&go1.5+)
go get ./../$PROJECT$/vendor/...
Installs all vendor packages of the current $PROJECT$ project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question