-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: compile asm files concurrently #15680
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
Comments
Related: #8893 |
They should probably also be scheduled concurrently with the compilation of the package. On my machine, compiling the math package (which is a bottleneck) takes 200ms, and occurs entirely before the assembler kicks in. |
See https://gist.github.com/josharian/d6bd51c4afd431bcbaee49deff0b2be3 for some raw output (generated with https://github.com/josharian/cmdgosnoop, which is work in progress). The format is: timestamp, number of concurrent jobs, list of concurrent jobs. A new line is started every time a job begins or ends. |
You can't do that in general because of -asmhdr. |
Ah. It looks like that's just set when compiling the runtime package. Is that right? |
It seems to only be used when the runtime package is being compiled, but On 17 May 2016 at 10:57, Josh Bleecher Snyder notifications@github.com
|
I don't think that flag is a problem, go_asm.h is generated by cmd/dist, On Tue, May 17, 2016 at 9:16 AM, Michael Hudson-Doyle <
|
On Tue, May 17, 2016 at 4:38 AM, Dave Cheney notifications@github.com
go_asm.h is generated by "go tool compile" for the package that is being It's true that the only std package that uses such facilities is the |
A better plan here might be teaching the assembler to accept and process multiple asm files in a single invocation. Looking into the timing, it appears that the exec (and command preparation) overhead easily matches or outweighs the time spent in the actual assembler. |
That certainly sounds worth investigating. Might be nice if it could just On 18 May 2016 at 07:46, Josh Bleecher Snyder notifications@github.com
|
I now have better ideas for bigger wins. Nevertheless, implemented this; straightforward and easy. Will mail for 1.8. |
TODO: test with gccgo Cuts 10% off wall time for ‘go build -a math’. Fixes golang#15680 Change-Id: I12d2ee2c817207954961dc8f37b8f2b09f835550
CL https://golang.org/cl/27636 mentions this issue. |
CL https://golang.org/cl/34284 mentions this issue. |
The effect of this was rolled back by CL 34284, which changed cmd/go to pass .s files to cmd/asm one at a time. When the assembler is fixed so that the test added by that CL passes, then the non-test part of the CL can be rolled back and this issue will be fixed again. |
For the 1.8 release, go back to invoking the assembler once per .s file, to avoid the problem in #18225. When the assembler is fixed, the change to cmd/go/build.go can be rolled back, but the test in cmd/go/go_test.go should remain. Fixes #18225. Update #15680. Change-Id: Ibff8d0c638536efb50a2b2c280b41399332f4fe4 Reviewed-on: https://go-review.googlesource.com/34284 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
As I wrote in #19277: If we want to allow the assembler to process multiple files then we would need to do this. |
It appears that cmd/go assembles all asm files in a package serially; AFAIK they can always be assembled concurrently. The assembler is fast, but it's not so fast that it wouldn't help. For example, the math package's asm files take 300ms cumulatively on my machine, and there are enough of them (and the math package is enough of a central dependency) that the concurrency savings would be worthwhile. Something similar holds for the runtime package.
The text was updated successfully, but these errors were encountered: