4 ms·
Is that because the libraries you link to are gigantic? Even so, the compiler shouldn’t be compiling those parts of the libraries that aren’t being used, right?
by xrisk 6y ago
Is that because the libraries you link to are gigantic? Even so, the compiler shouldn’t be compiling those parts of the libraries that aren’t being used, right?
- tym0 6y agoActix, Diesel, Serde and their dependencies are definitely most of build time.
- pjmlp 6y agoSo far cargo doesn't do binary dependencies, so when you start a project, or do CI/CD, it compiles the all world from scratch.
- chc 6y agoI'm not intimately familiar with the internals of rustc, but my impression was that everything gets compiled and dead code is later eliminated. In order to avoid compiling unnecessary stuff, you generally need to use feature flags (e.g. you can say "only compile this if the serialization feature is enabled").