Skip to content
This repository has been archived by the owner on Oct 19, 2019. It is now read-only.

Slow compile time #21

Open
defcube opened this issue Oct 3, 2015 · 6 comments
Open

Slow compile time #21

defcube opened this issue Oct 3, 2015 · 6 comments

Comments

@defcube
Copy link

defcube commented Oct 3, 2015

One of the amazing things about Go is how fast it compiles. Since installing the great v8worker lib, my build time has slowed from <1 second to around 20 seconds. This really slows down the TDD workflow that I normally use, because I'm waiting 20 seconds for a unit test to run.

Any suggestions on how to avoid recompiling the v8worker every time I make the project?

@emicklei
Copy link
Contributor

emicklei commented Oct 4, 2015

I noticed a similar increase in compilation but I think it is strongly related to my recent upgrade of Go SDK from 1.4.2 to 1.5.1 for which they rewrote the compiler (C -> Go). I have confidence that the speed will increase again with next versions.

@defcube
Copy link
Author

defcube commented Oct 4, 2015

Thanks for the feedback emicklei. I will hope for better performance in go 1.5.2 or beyond.

@ry
Copy link
Owner

ry commented Oct 4, 2015

I guess all the time is when the libv8.a is linked in. Maybe dynamic linking (for development builds) would speed things up.

@mmurray
Copy link

mmurray commented Dec 4, 2015

Can you provide any hints on how to try dynamic linking for development? This has been biting me for a while and I'd love to figure out a way to speed up the build in dev but I'm not very familiar with C++/cgo

@tav
Copy link
Contributor

tav commented Dec 5, 2016

If you want to speed things up during development, one way is to instruct the linker to omit the symbol table and debug info during builds:

go build -ldflags=-s

This will also generate significantly smaller binaries.

@sethwklein
Copy link

FWIW, this is golang/go#12259 .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants