You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Judging by https://perf.rust-lang.org, from-scratch builds with incremental compilation enabled adds about 15–20% overhead compared to disabled. The initial build needs to write out more intermediate state in order for later incremental builds to take advantage of it.
In a CI situation, it would be extremely unusual for there to be a later incremental build within the same job. The jobs are not making changes to source code and rebuilding.
However, workflows that cache the target directory across runs might be benefiting from incremental compilation.
The text was updated successfully, but these errors were encountered:
Generally the considered best-practice is to not cache local crate's artifacts in target, as the benefit of incremental for local changes is generally outweighed either by
using the first build with the cache key, thus an increasingly drifting out-of-date base, or
trashing and repopulating the cache on every run (GitHub workflow caching doesn't allow this).
Plus also just generally the cost of having a larger cache.
Swatinem/rust-cache is the current recommended cache action, which handles properly optimizing cache effectiveness for a cargo build in CI. That action also automatically sets CARGO_INCREMENTAL=0 for users of the action.
Judging by https://perf.rust-lang.org, from-scratch builds with incremental compilation enabled adds about 15–20% overhead compared to disabled. The initial build needs to write out more intermediate state in order for later incremental builds to take advantage of it.
In a CI situation, it would be extremely unusual for there to be a later incremental build within the same job. The jobs are not making changes to source code and rebuilding.
However, workflows that cache the
target
directory across runs might be benefiting from incremental compilation.The text was updated successfully, but these errors were encountered: