From: bors Date: Fri, 6 Apr 2018 18:52:22 +0000 (+0000) Subject: Auto merge of #5302 - Eh2406:MoreRc, r=alexcrichton X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~1^2~93 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d83f1130f36c191763f50ec5373a28e14195f5b5;p=cargo.git Auto merge of #5302 - Eh2406:MoreRc, r=alexcrichton use more Rc in the part of resolver that gets cloned a lot 2 This is the same idea as https://github.com/rust-lang/cargo/pull/5118, I was looking at a profile and noted that ~5% of our time was sent dropping `HashMap>`. A quick rg and I found the culprit, we are cloning the set of features for every new `Context`. With some Rc we are now just cloning for each time we insert. To benchmark I commented out line https://github.com/rust-lang/cargo/blob/b9aa315158fe4d8d63672a49200401922ef7385d/src/cargo/core/resolver/mod.rs#L453 the smallest change to get https://github.com/rust-lang/cargo/issues/4810#issuecomment-357553286 not to solve instantly. Before 17000000 ticks, 90s, 188.889 ticks/ms After 17000000 ticks, 73s, 232.877 ticks/ms --- d83f1130f36c191763f50ec5373a28e14195f5b5