▲ 170 ▼ 'Rust makes coding fun again': Why Linux is moving away from C, according to Greg Kroah-Hartman (www.zdnet.com) submitted 1 month ago by HaraldvonBlauzahn@feddit.org to c/linux@lemmy.ml 99 comments fedilink hide all child comments
[–] asdfasdfasdf@lemmy.world 7 points 1 month ago* (1 child) Five minutes with build cache? Or from cold build? With cache, then there's almost certainly something wrong with your computer or project. Also... you aren't building with --release every time are you? permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 4 points 1 month ago (1 child) No, I'm not using --release every time of course. And sometimes it's minutes even with the cache. permalink fedilink source parent hideshow 2 child comments replies: [–] asdfasdfasdf@lemmy.world 5 points 1 month ago (1 child) That's highly abnormal to have minute long debug build times. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (2 children) for 100k loc? permalink fedilink source parent hideshow 4 child comments replies: [–] MangoCats@feddit.it 5 points 1 month ago (1 child) 100k loc without a reasonable architecture is... problematic. I have run into problems with C++ linker/optimizers which will choke on big (50k loc) .cpp files which are auto-generated from definitions, they get slow like that, build times around 20 minutes for the worst of them. Keep the files more like 10k loc and down if you don't want this kind of issue. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 1 point 1 month ago* Nowhere did I say there's no reasonable architecture. Please don't put words in my mouth. What I said, is that I haven't found a good way to get quick compiles end to end. And already I don't have any files more than 3-4k loc, most are under 1k. permalink fedilink source parent [–] asdfasdfasdf@lemmy.world 3 points 1 month ago (1 child) Yeah I doubt it. I've worked in large Rust codebases too. I'd do some benchmarking. Cargo has some nice flags that let you see exactly what it's doing. You can open the compilation report up in a browser and zoom in on different steps of the process and see everything. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) I've tried looking before and couldn't get a significant improvement. I'll have to investigate it again I guess. permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 4 points 1 month ago (2 children) Make sure you're using a fast linker. Although I think lld is the default now, so that should be less of a concern these days. But see if mold or wild would help. More relevantly, you should be using cranelift for codegen in dev builds. If you have codegen-units = 1 in your release profile, make sure you have a separate dev profile that doesn't. If you still experience decapitating slowness (doubtful), and it's actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It's one of the project priorities now). Needless to say, but you should be checking your --timings to really know what's going on. permalink fedilink source parent hideshow 4 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) thanks will see what happens permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent [–] MangoCats@feddit.it 1 point 1 month ago The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive. permalink fedilink source parent
[–] yogthos@lemmy.ml 4 points 1 month ago (1 child) No, I'm not using --release every time of course. And sometimes it's minutes even with the cache. permalink fedilink source parent hideshow 2 child comments replies: [–] asdfasdfasdf@lemmy.world 5 points 1 month ago (1 child) That's highly abnormal to have minute long debug build times. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (2 children) for 100k loc? permalink fedilink source parent hideshow 4 child comments replies: [–] MangoCats@feddit.it 5 points 1 month ago (1 child) 100k loc without a reasonable architecture is... problematic. I have run into problems with C++ linker/optimizers which will choke on big (50k loc) .cpp files which are auto-generated from definitions, they get slow like that, build times around 20 minutes for the worst of them. Keep the files more like 10k loc and down if you don't want this kind of issue. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 1 point 1 month ago* Nowhere did I say there's no reasonable architecture. Please don't put words in my mouth. What I said, is that I haven't found a good way to get quick compiles end to end. And already I don't have any files more than 3-4k loc, most are under 1k. permalink fedilink source parent [–] asdfasdfasdf@lemmy.world 3 points 1 month ago (1 child) Yeah I doubt it. I've worked in large Rust codebases too. I'd do some benchmarking. Cargo has some nice flags that let you see exactly what it's doing. You can open the compilation report up in a browser and zoom in on different steps of the process and see everything. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) I've tried looking before and couldn't get a significant improvement. I'll have to investigate it again I guess. permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 4 points 1 month ago (2 children) Make sure you're using a fast linker. Although I think lld is the default now, so that should be less of a concern these days. But see if mold or wild would help. More relevantly, you should be using cranelift for codegen in dev builds. If you have codegen-units = 1 in your release profile, make sure you have a separate dev profile that doesn't. If you still experience decapitating slowness (doubtful), and it's actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It's one of the project priorities now). Needless to say, but you should be checking your --timings to really know what's going on. permalink fedilink source parent hideshow 4 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) thanks will see what happens permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent [–] MangoCats@feddit.it 1 point 1 month ago The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive. permalink fedilink source parent
[–] asdfasdfasdf@lemmy.world 5 points 1 month ago (1 child) That's highly abnormal to have minute long debug build times. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (2 children) for 100k loc? permalink fedilink source parent hideshow 4 child comments replies: [–] MangoCats@feddit.it 5 points 1 month ago (1 child) 100k loc without a reasonable architecture is... problematic. I have run into problems with C++ linker/optimizers which will choke on big (50k loc) .cpp files which are auto-generated from definitions, they get slow like that, build times around 20 minutes for the worst of them. Keep the files more like 10k loc and down if you don't want this kind of issue. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 1 point 1 month ago* Nowhere did I say there's no reasonable architecture. Please don't put words in my mouth. What I said, is that I haven't found a good way to get quick compiles end to end. And already I don't have any files more than 3-4k loc, most are under 1k. permalink fedilink source parent [–] asdfasdfasdf@lemmy.world 3 points 1 month ago (1 child) Yeah I doubt it. I've worked in large Rust codebases too. I'd do some benchmarking. Cargo has some nice flags that let you see exactly what it's doing. You can open the compilation report up in a browser and zoom in on different steps of the process and see everything. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) I've tried looking before and couldn't get a significant improvement. I'll have to investigate it again I guess. permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 4 points 1 month ago (2 children) Make sure you're using a fast linker. Although I think lld is the default now, so that should be less of a concern these days. But see if mold or wild would help. More relevantly, you should be using cranelift for codegen in dev builds. If you have codegen-units = 1 in your release profile, make sure you have a separate dev profile that doesn't. If you still experience decapitating slowness (doubtful), and it's actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It's one of the project priorities now). Needless to say, but you should be checking your --timings to really know what's going on. permalink fedilink source parent hideshow 4 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) thanks will see what happens permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent [–] MangoCats@feddit.it 1 point 1 month ago The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive. permalink fedilink source parent
[–] yogthos@lemmy.ml 2 points 1 month ago (2 children) for 100k loc? permalink fedilink source parent hideshow 4 child comments replies: [–] MangoCats@feddit.it 5 points 1 month ago (1 child) 100k loc without a reasonable architecture is... problematic. I have run into problems with C++ linker/optimizers which will choke on big (50k loc) .cpp files which are auto-generated from definitions, they get slow like that, build times around 20 minutes for the worst of them. Keep the files more like 10k loc and down if you don't want this kind of issue. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 1 point 1 month ago* Nowhere did I say there's no reasonable architecture. Please don't put words in my mouth. What I said, is that I haven't found a good way to get quick compiles end to end. And already I don't have any files more than 3-4k loc, most are under 1k. permalink fedilink source parent [–] asdfasdfasdf@lemmy.world 3 points 1 month ago (1 child) Yeah I doubt it. I've worked in large Rust codebases too. I'd do some benchmarking. Cargo has some nice flags that let you see exactly what it's doing. You can open the compilation report up in a browser and zoom in on different steps of the process and see everything. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) I've tried looking before and couldn't get a significant improvement. I'll have to investigate it again I guess. permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 4 points 1 month ago (2 children) Make sure you're using a fast linker. Although I think lld is the default now, so that should be less of a concern these days. But see if mold or wild would help. More relevantly, you should be using cranelift for codegen in dev builds. If you have codegen-units = 1 in your release profile, make sure you have a separate dev profile that doesn't. If you still experience decapitating slowness (doubtful), and it's actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It's one of the project priorities now). Needless to say, but you should be checking your --timings to really know what's going on. permalink fedilink source parent hideshow 4 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) thanks will see what happens permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent [–] MangoCats@feddit.it 1 point 1 month ago The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive. permalink fedilink source parent
[–] MangoCats@feddit.it 5 points 1 month ago (1 child) 100k loc without a reasonable architecture is... problematic. I have run into problems with C++ linker/optimizers which will choke on big (50k loc) .cpp files which are auto-generated from definitions, they get slow like that, build times around 20 minutes for the worst of them. Keep the files more like 10k loc and down if you don't want this kind of issue. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 1 point 1 month ago* Nowhere did I say there's no reasonable architecture. Please don't put words in my mouth. What I said, is that I haven't found a good way to get quick compiles end to end. And already I don't have any files more than 3-4k loc, most are under 1k. permalink fedilink source parent
[–] yogthos@lemmy.ml 1 point 1 month ago* Nowhere did I say there's no reasonable architecture. Please don't put words in my mouth. What I said, is that I haven't found a good way to get quick compiles end to end. And already I don't have any files more than 3-4k loc, most are under 1k. permalink fedilink source parent
[–] asdfasdfasdf@lemmy.world 3 points 1 month ago (1 child) Yeah I doubt it. I've worked in large Rust codebases too. I'd do some benchmarking. Cargo has some nice flags that let you see exactly what it's doing. You can open the compilation report up in a browser and zoom in on different steps of the process and see everything. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) I've tried looking before and couldn't get a significant improvement. I'll have to investigate it again I guess. permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 4 points 1 month ago (2 children) Make sure you're using a fast linker. Although I think lld is the default now, so that should be less of a concern these days. But see if mold or wild would help. More relevantly, you should be using cranelift for codegen in dev builds. If you have codegen-units = 1 in your release profile, make sure you have a separate dev profile that doesn't. If you still experience decapitating slowness (doubtful), and it's actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It's one of the project priorities now). Needless to say, but you should be checking your --timings to really know what's going on. permalink fedilink source parent hideshow 4 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) thanks will see what happens permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent [–] MangoCats@feddit.it 1 point 1 month ago The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive. permalink fedilink source parent
[–] yogthos@lemmy.ml 2 points 1 month ago (1 child) I've tried looking before and couldn't get a significant improvement. I'll have to investigate it again I guess. permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 4 points 1 month ago (2 children) Make sure you're using a fast linker. Although I think lld is the default now, so that should be less of a concern these days. But see if mold or wild would help. More relevantly, you should be using cranelift for codegen in dev builds. If you have codegen-units = 1 in your release profile, make sure you have a separate dev profile that doesn't. If you still experience decapitating slowness (doubtful), and it's actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It's one of the project priorities now). Needless to say, but you should be checking your --timings to really know what's going on. permalink fedilink source parent hideshow 4 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) thanks will see what happens permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent [–] MangoCats@feddit.it 1 point 1 month ago The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive. permalink fedilink source parent
[–] ISO@lemmy.zip 4 points 1 month ago (2 children) Make sure you're using a fast linker. Although I think lld is the default now, so that should be less of a concern these days. But see if mold or wild would help. More relevantly, you should be using cranelift for codegen in dev builds. If you have codegen-units = 1 in your release profile, make sure you have a separate dev profile that doesn't. If you still experience decapitating slowness (doubtful), and it's actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It's one of the project priorities now). Needless to say, but you should be checking your --timings to really know what's going on. permalink fedilink source parent hideshow 4 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago (1 child) thanks will see what happens permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent [–] MangoCats@feddit.it 1 point 1 month ago The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive. permalink fedilink source parent
[–] yogthos@lemmy.ml 2 points 1 month ago (1 child) thanks will see what happens permalink fedilink source parent hideshow 2 child comments replies: [–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent
[–] ISO@lemmy.zip 1 point 1 month ago (1 child) It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here. Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile. permalink fedilink source parent hideshow 2 child comments replies: [–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent
[–] yogthos@lemmy.ml 2 points 1 month ago yeah, if I find any dramatic improvement I'll follow up permalink fedilink source parent
[–] MangoCats@feddit.it 1 point 1 month ago The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive. permalink fedilink source parent