Skip to content

Commit

Permalink
Auto merge of #7326 - Eh2406:map_dependencies, r=ehuss
Browse files Browse the repository at this point in the history
`map_dependencies` is doing a deep clone, so lets make it cheaper

This removes a `FeatureMap::clone` that I noticed when profiling no-op builds of cargo, benchmarks show a ~5% improvement. Looks like #6880 means that there is a ref to every `Summery` so the `Rc::make_mut` dose a deep clone.
  • Loading branch information
bors committed Sep 4, 2019
2 parents e9fc779 + 880337a commit 8f5bdc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cargo/core/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct Summary {
struct Inner {
package_id: PackageId,
dependencies: Vec<Dependency>,
features: FeatureMap,
features: Rc<FeatureMap>,
checksum: Option<String>,
links: Option<InternedString>,
namespaced_features: bool,
Expand Down Expand Up @@ -64,7 +64,7 @@ impl Summary {
inner: Rc::new(Inner {
package_id: pkg_id,
dependencies,
features: feature_map,
features: Rc::new(feature_map),
checksum: None,
links: links.map(|l| l.into()),
namespaced_features,
Expand Down

0 comments on commit 8f5bdc4

Please sign in to comment.