7 ms·
> Honestly, who cares about the difference between 1s vs 100ms vs 10ms for a build though? I definitely do. Not necessarily because of the 10ms vs 1s. But beca
by alain_gilbert 11mo ago
> Honestly, who cares about the difference between 1s vs 100ms vs 10ms for a build though?
I definitely do. Not necessarily because of the 10ms vs 1s. But because of the later stage when it becomes 600ms vs 60s.
- littlestymaar 11mo ago> But because of the later stage when it becomes 600ms vs 60s. What later stage though, as I said I worked with big code bases on old hardware without issues. I'm simply not convinced that there exist a situation where incremental rebuild of the crate you're working on is going to take 60s, at all, especially if you're using hardware from this decade.
- alain_gilbert 11mo agoI have a fairly small go project (100k loc) and it takes ~30sec to build. I'd be thrilled to have it build in 300ms. (Using a macbook pro 2019)
- nicoburns 11mo agoConsider upgrading your hardware if/when you get a chance to (obviously this is expensive). My builds (Rust not Go, but it might well be similar?) got 10x faster when I upgraded from a 2015 MBP to an M1. I suspect 2019 to M4 might be similar.
- lenkite 11mo agoThat's strange. Humongous k8s Go projects (>500k LOC) build in a third of that time. Do you have lots of deps in your `go.mod` ? Is the project abusing codegen ?
- alain_gilbert 11mo ago61 dependencies, no codegen. Nothing special really.
- littlestymaar 11mo ago> I have a fairly small go project (100k loc) and it takes ~30sec to build. Wait, aren't Go builds supposed to be fast?
- Orygin 11mo agoOn a Macbook M2 Pro, on a project with loads of services, 210k loc, a full rebuild takes 70 seconds. Incremental takes 36s. For one service, full rebuild in 16s and incremental 0.6s. It's not blazing fast but considering the scale of the project, it's not that bad, especially since I rarely rebuild every service at the same time.
- yencabulator 11mo agoAre you using CGo? C compilation slowness doesn't count.
- merely-unlikely 11mo agoI must be doing something wrong because incremental builds regularly take 30-60 seconds for me. Much more if I add a dependency. And I try to keep my crates small.
- balamatom 11mo agoPSA: try https://github.com/rui314/mold https://github.com/rui314/mold (Not affiliated with the project. Just switched to it and never looked back.)
- littlestymaar 11mo agoAs a sibling comment points out, it's likely to be mostly link time, not compilation time. The most recent Rust version ships with `lld` so it shouldn't be the case anymore (afaik `lld` is a bit slower than the `mold` linker, but it's close, much closer than the system linker that was previously being used by default).
- pjmlp 11mo agoApparently Bevy doesn't need that big tutorial on how to customise Rust toolchains for usable builds then.
- littlestymaar 11mo agoCome on. There's no “big tutorial” though. There's a section about compilation time performance[1] but it's arguably not “big”, and the most impactful parts of it is about linking time, not compilation time. And half of the section is now obsolete since rust uses `lld` by default. [1] https://bevy.org/learn/quick-start/getting-started/setup/#enable-fast-compiles-optional https://bevy.org/learn/quick-start/getting-started/setup/#en...
- pjmlp 11mo agoOnly if you happen to be on a platform where lld is supported.
- littlestymaar 11mo agoWhich platform does that description excludes? Edit: oh I get it you probably meant “where lld is set as default ” which is currently Linux only. Lld is supported by the other platforms though, so you can just copy-paste the three lines of configuration given on the Bevy page and call it a day.