Live data from Hacker News

Compile Go programs 7x faster

github.com

1–10 of 30 posts

Re: Compile Go programs 7x faster

#4

This is basically a wrapper for 'go install'. See this post / linked blog posts for an explanation why this is faster/useful: https://twitter.com/davecheney/status/697171533215576064

Yes, never use go build, always use go install!

go build builds everything, whereas go install does an incremental build on the stuff that has changed and installs it (either in GOPATH/bin or GOPATH/pkg).

Re: Compile Go programs 7x faster

#6

This is basically a wrapper for 'go install'. See this post / linked blog posts for an explanation why this is faster/useful: https://twitter.com/davecheney/status/697171533215576064

"all the go commands operate on packages, the use of files is a degenerate case only to support go run"

guilty. typing in "go run" for quick scripts is one hard to conquer habit ;)

Re: Compile Go programs 7x faster

#7

This is basically a wrapper for 'go install'. See this post / linked blog posts for an explanation why this is faster/useful: https://twitter.com/davecheney/status/697171533215576064

"all the go commands operate on packages, the use of files is a degenerate case only to support go run" guilty. typing in "go run" for quick scripts is one hard to conquer habit ;)

For quick scripts I don't see how it's wrong. I mean, even wrong is really just "wasting time a bit" here.

Re: Compile Go programs 7x faster

#9
post #8

Maybe I'm daft, but his table says 502 lines in 1.558 seconds. So 322 lines/second. I thought the Go compiler was supposed to be amazingly fast? That is not fast at all.

This number is not true I guess. scalac with idomatic Scala code (no Macro's) is at 500-700 loc/sec. (And scalac is considered slow by many people)

Source: https://www.youtube.com/watch?v=WxyyJyB_Ssc

That would be a slowdown of like 4x to current javac, I guess his computer is just not good enough?

Re: Compile Go programs 7x faster

#10
post #4

This is basically a wrapper for 'go install'. See this post / linked blog posts for an explanation why this is faster/useful: https://twitter.com/davecheney/status/697171533215576064

Yes, never use go build, always use go install! go build builds everything, whereas go install does an incremental build on the stuff that has changed and installs it (either in GOPATH/bin or GOPATH/pkg).

Why does "go build" build more than what is necessary for "go install"?

Shouldn't "go build" just do incremental builds and be faster across the board?

Post reply on HN