Re:The Rust compiler isn't slow; we are
by est31 on Wednesday June 17, 2020 @08:00AM
(#23550356)
Most of the stuff your linker has to churn through is actually debug info. If you turn it off, you'll speed up linking whether it's with LLD, gold, or ld.bfd. Do this in Cargo.toml:
[ Parent
| on HN ]
Re:The Rust compiler isn't slow; we are
by vanderZwan on Wednesday June 17, 2020 @10:42AM
(#23552002)
What if you don't really program in Rust yourself but still cargo install the cool CLI tools that people have produced in it? Is there something I can tweak in my global settings for speeding that up?
Re:The Rust compiler isn't slow; we are
by jiripospisil on Wednesday June 17, 2020 @08:20AM
(#23550484)
Thanks, I will test it out when I get home.
Re:The Rust compiler isn't slow; we are
by jfkebwjsbx on Wednesday June 17, 2020 @08:30AM
(#23550571)
Note that disabling debug info means way, way harder debugging!
As the sibling comment says, you can always turn it back on when you want to do debugging. Personally, I mainly do printf debugging so I don't miss it much. Also there is the option of only turning it off for dependencies like:
[profile.dev.package."*"]
debug = false
I haven't tested how big the impact of that is, but it should be pretty large for projects with a larger number of dependencies.Edit: I've tested it now on cargo-udeps [1], which has a large crate graph but only little code of its own and there is only a small difference between turning off debuginfo for all crates vs only for dependencies, but a sizeable improvement over compiling in debuginfo of dependencies.
[1]: https://gist.github.com/est31/1bb6e7d6f4be2a23701b8c7c1c678b...
Re:The Rust compiler isn't slow; we are
by jiripospisil on Wednesday June 17, 2020 @08:41AM
(#23550670)
Oh sure, usually I want to build/run it way more often than debug it though. And if I do need to debug it, I could just turn it back on and rebuild.