Commit c3e8aa3
authored
Auto merge of #241 - mpdn:master, r=mbrubeck
Remove extraneous branch from push
`push` does two branches on the "smallness" of the `smallvec`: one before the reserve check and one after. LLVM doesn't seem to optimize the second branch away for the (very common) non-growing case. In addition, in the growing branch we know the memory will be on the heap, so no need to branch here.
On my machine, this improves `bench_push` from approx 300ns to 263ns (+/- 5 on both).1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
757 | | - | |
| 756 | + | |
| 757 | + | |
758 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
759 | 762 | | |
760 | | - | |
761 | | - | |
762 | | - | |
| 763 | + | |
| 764 | + | |
763 | 765 | | |
764 | 766 | | |
765 | 767 | | |
| |||
0 commit comments