Skip to content
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

Investigate the impact of using Gold for linking rather than the default linker on systems where it is available #29938

Closed
bstrie opened this issue Nov 19, 2015 · 8 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries I-compiletime Issue: Problems and improvements with respect to compile times.

Comments

@bstrie
Copy link
Contributor

bstrie commented Nov 19, 2015

Inspired by @alexcrichton 's comment here: https://www.reddit.com/r/rust/comments/3tco32/shattering_a_crate_in_pursuit_of_compile_times/cx58vrt

First we need to gather data on how much Gold benefits compiler performance. Collect some large Rust projects and use time-passes to determine the relative impact of using different linkers. Initial results should be promising: https://www.reddit.com/r/rust/comments/3tco32/shattering_a_crate_in_pursuit_of_compile_times/cx5yrmq

If we decide that the performance win is worth it then we need to decide how best to implement this scheme. Does anyone foresee any problems with selectively preferring a linker that's not the default on a system? It has echoes of the headaches we've had with preferring jemalloc over the system allocator.

@bstrie bstrie added A-linkage Area: linking into static, shared libraries and binaries I-slow Issue: Problems and improvements with respect to performance of generated code. labels Nov 20, 2015
@brson
Copy link
Contributor

brson commented Nov 20, 2015

Another thread: https://internals.rust-lang.org/t/how-to-move-to-the-gold-linker-on-linux/2576

I've done tests against servo, and on servo the wins were big - they now customize their build to prefer gold. I also have a patch that defaults to gold and am running it through crater to look for regressions now.

@brson
Copy link
Contributor

brson commented Nov 20, 2015

Everything that crater can build appears to build under gold.

@alexcrichton
Copy link
Member

:shipit:

@bstrie
Copy link
Contributor Author

bstrie commented Nov 24, 2015

@brson I'd say making this change deserves a brief RFC (especially if it introduces new command-line arguments). I don't foresee any objections, but if there are any weird use cases that we're not considering we want to make sure this change is visible.

@bstrie
Copy link
Contributor Author

bstrie commented Nov 24, 2015

I've also been perpetually anticipating the advent of LLD for the past four years, so if we go ahead with the change we may want to clarify that we reserve the right to change the default linker in the future as well.

@brson
Copy link
Contributor

brson commented Dec 1, 2015

There's a PR open.

@mikosdikos
Copy link

#31164

@sanxiyn sanxiyn added I-compiletime Issue: Problems and improvements with respect to compile times. and removed I-slow Issue: Problems and improvements with respect to performance of generated code. labels Apr 21, 2016
@bstrie
Copy link
Contributor Author

bstrie commented Jul 14, 2016

Closing in favor of #30783

@bstrie bstrie closed this as completed Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries I-compiletime Issue: Problems and improvements with respect to compile times.
Projects
None yet
Development

No branches or pull requests

5 participants