diff --git a/src/toolchain/distributable.rs b/src/toolchain/distributable.rs index 48b3dd2b00..a1787f4faa 100644 --- a/src/toolchain/distributable.rs +++ b/src/toolchain/distributable.rs @@ -134,6 +134,12 @@ impl<'a> DistributableToolchain<'a> { components: &[&str], targets: &[&str], ) -> anyhow::Result { + // Performance optimization: avoid loading the manifest (which can be expensive) + // if there are no components/targets to check. + if components.is_empty() && targets.is_empty() { + return Ok(true); + } + let manifestation = self.get_manifestation()?; let manifest = manifestation.load_manifest()?; let manifest = match manifest {