Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: GO19CONCURRENTCOMPILATION not working as expected #21236
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
I just realized the
time GO19CONCURRENTCOMPILATION=0 go1.9rc1 build -gcflags=-c=1 -o ponzu-server cmd/ponzu/*.go GO19CONCURRENTCOMPILATION=0 go1.9rc1 build -gcflags=-c=1 -o ponzu-server 1.50s user 0.16s system 132% cpu 1.259 total # --- time GO19CONCURRENTCOMPILATION=1 go1.9rc1 build -gcflags=-c=1 -o ponzu-server cmd/ponzu/*.go GO19CONCURRENTCOMPILATION=1 go1.9rc1 build -gcflags=-c=1 -o ponzu-server 1.48s user 0.19s system 132% cpu 1.255 total # --- time GO19CONCURRENTCOMPILATION=1 go1.9rc1 build -gcflags=-c=2 -o ponzu-server cmd/ponzu/*.go GO19CONCURRENTCOMPILATION=1 go1.9rc1 build -gcflags=-c=2 -o ponzu-server 1.74s user 0.14s system 139% cpu 1.346 total # --- time GO19CONCURRENTCOMPILATION=1 go1.9rc1 build -gcflags=-c=4 -o ponzu-server cmd/ponzu/*.go GO19CONCURRENTCOMPILATION=1 go1.9rc1 build -gcflags=-c=4 -o ponzu-server 1.71s user 0.19s system 113% cpu 1.680 total
Though, I'm unclear if the > 100% cpu usage reported above when
Thanks for the report.
I took a look at package
This will tell you the individual toolchain commands being run and time them individually, and then print an overall total. On my machine, I see concurrent compilation taking ~0.09s and non-concurrent compilation taking ~0.14s. Linking takes about 0.65s. There's another 0.25s spend in the
As for the place where "nBackendWorkers is set to 1", that's addressed in change 41503, which was intentionally held for 1.10. But it's not obvious to me that that is an important factor in this case. If you want to experiment, or if that change makes your life much better now, feel free to cherry-pick that change and rebuild the toolchain.
So I think everything is working as intended here. I don't see any obvious doc changes to make, although I'm open to suggestions.
For now, I'm going to close this, but will re-open if there's new information or suggestions.
That's cool. Wasn't aware of this -- thanks for pointing it out.
I see -- thank you for pointing this out as well. I couldn't tell how much of each package could be compiled before the
This was reported entirely out of experimentation, and I hope it didn't cause you many wasted cycles
FWIW, this makes a noticeable difference in (generally autogenerated) packages that define thousands of types.
Appreciated! Very glad you're kicking the tires.