Skip to content

Commit

Permalink
Avoid forking for identical markers
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jan 11, 2025
1 parent 918ddef commit 5b41326
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/uv-resolver/src/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3302,6 +3302,21 @@ impl Forks {
}
continue;
}
} else {
// If all dependencies have the same markers, we should also avoid forking.
if let Some(dep) = deps.first() {
let marker = dep.package.marker();
if deps.iter().all(|dep| marker == dep.package.marker()) {
for dep in deps {
for fork in &mut forks {
if fork.env.included_by_marker(marker) {
fork.add_dependency(dep.clone());
}
}
}
continue;
}
}
}
for dep in deps {
let mut forker = match ForkingPossibility::new(env, &dep) {
Expand Down

0 comments on commit 5b41326

Please sign in to comment.