Uh oh!
There was an error while loading. Please reload this page.
Improve clone_from impls for collections - #28602
Conversation
dotdash
commented
Sep 23, 2015
@bors r+ Nice! |
bors
commented
Sep 23, 2015
📌 Commit 85be55b has been approved by |
bors
commented
Sep 23, 2015
⌛ Testing commit 85be55b with merge 8de4886... |
bluss
commented
Sep 23, 2015
Did you push a new commit after bors tested the old one. What was the change? |
There was a problem hiding this comment.
This trick might warrant a comment.
apasel422
commented
Sep 23, 2015
@bluss Yeah, I pushed a new commit, so bors hasn't tested the new one yet. I removed an unnecessary call to I'll add a comment that explains the trick and re-push. |
bluss
commented
Sep 23, 2015
Great |
apasel422
commented
Sep 23, 2015
Hmm, instead of using the trick, should I just use a more explicit (and less finicky) |
bluss
commented
Sep 23, 2015
It's almost about time we package up this "zip slices" pattern now in a function or iterator actually, since we have to use it in a lot of places. I think your question is interesting:
(2) can absolutely be called fragile. I still like (2) better since it's safe, it degrades well (still correct even if the optimizer's behavior changes). |
apasel422
commented
Sep 23, 2015
It's actually already present in |
bluss
commented
Sep 23, 2015
yes, for clone in particular it seems it is. We can reuse that here, then. |
apasel422
commented
Sep 23, 2015
Updated. |
bluss
commented
Sep 23, 2015
Now it's beautiful @bors r+ |
bors
commented
Sep 23, 2015
📌 Commit 2f1084a has been approved by |
bors
commented
Sep 24, 2015
⌛ Testing commit 2f1084a with merge 450f87f... |
bors
commented
Sep 24, 2015
💔 Test failed - auto-mac-64-opt |
Before: test dst_bigger::src_100_dst_1000::clone ... bench: 34 ns/iter (+/- 1) test dst_bigger::src_100_dst_1000::clone_from ... bench: 75 ns/iter (+/- 3) test dst_bigger::src_10_dst_100::clone ... bench: 25 ns/iter (+/- 0) test dst_bigger::src_10_dst_100::clone_from ... bench: 9 ns/iter (+/- 1) test eq::src_1000_dst_1000::clone ... bench: 105 ns/iter (+/- 2) test eq::src_1000_dst_1000::clone_from ... bench: 593 ns/iter (+/- 21) test eq::src_100_dst_100::clone ... bench: 34 ns/iter (+/- 1) test eq::src_100_dst_100::clone_from ... bench: 75 ns/iter (+/- 1) test src_bigger::src_1000_dst_100::clone ... bench: 103 ns/iter (+/- 5) test src_bigger::src_1000_dst_100::clone_from ... bench: 148 ns/iter (+/- 5) test src_bigger::src_100_dst_10::clone ... bench: 34 ns/iter (+/- 1) test src_bigger::src_100_dst_10::clone_from ... bench: 20 ns/iter (+/- 0) After: test dst_bigger::src_100_dst_1000::clone ... bench: 34 ns/iter (+/- 2) test dst_bigger::src_100_dst_1000::clone_from ... bench: 15 ns/iter (+/- 1) test dst_bigger::src_10_dst_100::clone ... bench: 26 ns/iter (+/- 1) test dst_bigger::src_10_dst_100::clone_from ... bench: 7 ns/iter (+/- 0) test eq::src_1000_dst_1000::clone ... bench: 103 ns/iter (+/- 1) test eq::src_1000_dst_1000::clone_from ... bench: 85 ns/iter (+/- 4) test eq::src_100_dst_100::clone ... bench: 34 ns/iter (+/- 2) test eq::src_100_dst_100::clone_from ... bench: 15 ns/iter (+/- 1) test src_bigger::src_1000_dst_100::clone ... bench: 103 ns/iter (+/- 4) test src_bigger::src_1000_dst_100::clone_from ... bench: 90 ns/iter (+/- 2) test src_bigger::src_100_dst_10::clone ... bench: 34 ns/iter (+/- 2) test src_bigger::src_100_dst_10::clone_from ... bench: 20 ns/iter (+/- 0) Closes#28601.
apasel422
commented
Sep 24, 2015
Fixed the test failure. |
bluss
commented
Sep 24, 2015
@bors r+ thanks! |
bors
commented
Sep 24, 2015
📌 Commit 97f2a32 has been approved by |
r? @bluss