6 ms·
You think 20 seconds isn't a long compile time!?
by nicoburns 5y ago
You think 20 seconds isn't a long compile time!?
- axiosgunnar 5y agoI don't see the problem. Since it's an external crate, it will compile exactly once after adding it to Cargo.toml, and will be cached forever.
- unanswered 5y agoI'm convinced that most of the people complaining about build times are using docker for some incomprehensible reason and are blowing away the dependency cache with every build.
- rowanG077 5y agoThis. It's annoying to compile from scratch. But I almost never have to do that. So I don't really have a problem with compile times.
- nicoburns 5y agoNope. FWIW, I conpile on a MacBook. So I only have 2 cores, and laptop ones at that. Perhaps that's affecting our difference in perspective? I also had a project a couple of years ago where I had to compile it in release mode to get reasonable performance for testing (Iw as processing GB's of data), which meant 2-3min incremental compile times. Not fun!
- kzrdude 5y agoforever, or until rust version update (might be often for nightly builds), or until build flag change or cargo clean, whichever happens first. It's also only a per-project target directory (not across all projects you compile).
- kibwen 5y agoEven for people on nightly builds of the compiler, I would be quite surprised if nearly anyone actually bothered to upgrade their compiler every night. Most people on nightly are just going to be there for the use of a specific unstable feature.
- finnb 5y agoCached locally, sure. The point of bazel with remote execution and remote caching is that it's then available in the cloud for everyone to access.
- jeroenhd 5y agoThis depends on what the library does, of course. From a quick Google I believe the parent has made several packages, like a front-end to help with XML trees or a full wrapper around procfs. Libraries that complex (especially with their dependencies) can take significant time to compile, it's just a consequence of their complexity. Some smaller libraries I've seen that just do some annoying-to-test but simple string manipulations have had similar compile times, mostly because they include specific versions of advanced logging or error reporting libraries for no obvious reason.
- eminence32 5y agoYup, that's me :) For example in the `procfs` crate, there's a dependency on `flate2` just in case a /boot/config.gz file exists (in order to see what options the kernel was built with). But if a consumer never needs to inspect the kernel options, this dependency (and related code) is just dead-weight. The nice thing about rust is that this code will be removed from the final executable if it's unused, but maybe it's time to start thinking more carefully about compile times.
- deleted 5y ago[deleted]
- alkonaut 5y agoIt all depends on how many times you do it! 20 seconds for an edit-compile loop is huge. 20 seconds for a CI build is not as bad, but still bad (if you have dozens more). 20 seconds once per machine per dependency version (i.e. there is no rebuild of the dependency until you change compiler flags or update the library) is OK.