Commit f39ba69
committed
auto merge of #13539 : Aatch/rust/vector-copy-faster, r=thestinger
LLVM wasn't recognising the loops as memcpy loops and was therefore failing to optimise them properly. While improving LLVM is the "proper" way to fix this, I think that these cases are important enough to warrant a little low-level optimisation.
Fixes #13472
r? @thestinger
---
Benchmark Results:
```
--- Before ---
test clone_owned ... bench: 6126104 ns/iter (+/- 285962) = 170 MB/s
test clone_owned_to_owned ... bench: 6125054 ns/iter (+/- 271197) = 170 MB/s
test clone_str ... bench: 80586 ns/iter (+/- 11489) = 13011 MB/s
test clone_vec ... bench: 3903220 ns/iter (+/- 658556) = 268 MB/s
test test_memcpy ... bench: 69401 ns/iter (+/- 2168) = 15108 MB/s
--- After ---
test clone_owned ... bench: 70839 ns/iter (+/- 4931) = 14801 MB/s
test clone_owned_to_owned ... bench: 70286 ns/iter (+/- 4836) = 14918 MB/s
test clone_str ... bench: 78519 ns/iter (+/- 5511) = 13353 MB/s
test clone_vec ... bench: 71415 ns/iter (+/- 1999) = 14682 MB/s
test test_memcpy ... bench: 70980 ns/iter (+/- 2126) = 14772 MB/s
```2 files changed
+38
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
764 | | - | |
765 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
766 | 782 | | |
767 | 783 | | |
768 | 784 | | |
| |||
2584 | 2600 | | |
2585 | 2601 | | |
2586 | 2602 | | |
2587 | | - | |
| 2603 | + | |
| 2604 | + | |
2588 | 2605 | | |
2589 | 2606 | | |
2590 | 2607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
315 | 331 | | |
316 | 332 | | |
317 | 333 | | |
| |||
0 commit comments