<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/liballoc, branch 1.27.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.27.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.27.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2018-05-21T13:55:25+00:00</updated>
<entry>
<title>Stabilise inclusive_range_methods</title>
<updated>2018-05-21T13:55:25+00:00</updated>
<author>
<name>varkor</name>
<email>github@varkor.com</email>
</author>
<published>2018-05-14T22:25:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3070f394629ae8c6463269247ea0cb223d5328f1'/>
<id>urn:sha1:3070f394629ae8c6463269247ea0cb223d5328f1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: Avoid `ptr::copy` if unnecessary in `vec::Drain`</title>
<updated>2018-05-10T20:59:03+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2018-05-09T15:33:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dfc9570b492ca0ec081214020ae80926b0e1d134'/>
<id>urn:sha1:dfc9570b492ca0ec081214020ae80926b0e1d134</id>
<content type='text'>
This commit is spawned out of a performance regression investigation in #50496.
In tracking down this regression it turned out that the `expand_statements`
function in the compiler was taking quite a long time. Further investigation
showed two key properties:

* The function was "fast" on glibc 2.24 and slow on glibc 2.23
* The hottest function was memmove from glibc

Combined together it looked like glibc gained an optimization to the memmove
function in 2.24. Ideally we don't want to rely on this optimization, so I
wanted to dig further to see what was happening.

The hottest part of `expand_statements` was `Drop for Drain` in the call to
`splice` where we insert new statements into the original vector. This *should*
be a cheap operation because we're draining and replacing iterators of the exact
same length, but under the hood memmove was being called a lot, causing a
slowdown on glibc 2.23.

It turns out that at least one of the optimizations in glibc 2.24 was that
`memmove` where the src/dst are equal becomes much faster. [This program][prog]
executes in ~2.5s against glibc 2.23 and ~0.3s against glibc 2.24, exhibiting
how glibc 2.24 is optimizing `memmove` if the src/dst are equal.

And all that brings us to what this commit itself is doing. The change here is
purely to `Drop for Drain` to avoid the call to `ptr::copy` if the region being
copied doesn't actually need to be copied. For normal usage of just `Drain`
itself this check isn't really necessary, but because `Splice` internally
contains `Drain` this provides a nice speed boost on glibc 2.23. Overall this
should fix the regression seen in #50496 on glibc 2.23 and also fix the
regression on Windows where `memmove` looks to not have this optimization.

Note that the way `splice` was called in `expand_statements` would cause a
quadratic number of elements to be copied via `memmove` which is likely why the
tuple-stress benchmark showed such a severe regression.

Closes #50496

[prog]: https://gist.github.com/alexcrichton/c05bc51c6771bba5ae5b57561a6c1cd3
</content>
</entry>
<entry>
<title>Use ManuallyDrop instead of Option in Hole implementation</title>
<updated>2018-05-06T14:55:40+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>nikita.ppv@gmail.com</email>
</author>
<published>2018-05-06T14:55:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9f8f366eeabee6273abf3628bb75ecd3b4b57f22'/>
<id>urn:sha1:9f8f366eeabee6273abf3628bb75ecd3b4b57f22</id>
<content type='text'>
The Option is always Some until drop, where it becomes None. Make
this more explicit and avoid unwraps by using ManuallyDrop.

This change should be performance-neutral as LLVM already optimizes
the unwraps away in the inlined code.
</content>
</entry>
<entry>
<title>Auto merge of #49724 - kennytm:range-inc-start-end-methods, r=Kimundi</title>
<updated>2018-05-01T10:10:46+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2018-05-01T10:10:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a4a79472598e24a60301fb99f27dc688cc365d5a'/>
<id>urn:sha1:a4a79472598e24a60301fb99f27dc688cc365d5a</id>
<content type='text'>
Introduce RangeInclusive::{new, start, end} methods and make the fields private.

cc #49022
</content>
</entry>
<entry>
<title>Auto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakis</title>
<updated>2018-04-30T22:02:33+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2018-04-30T22:02:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=357bf00f1c0ee065239ee0213b854ee65f44eb03'/>
<id>urn:sha1:357bf00f1c0ee065239ee0213b854ee65f44eb03</id>
<content type='text'>
stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940)

r? @nikomatsakis
</content>
</entry>
<entry>
<title>Rollup merge of #50233 - mark-i-m:const_vec, r=kennytm</title>
<updated>2018-04-30T17:18:36+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2018-04-30T17:18:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b88c152784f36825a2a75b062db6cc55ff02297f'/>
<id>urn:sha1:b88c152784f36825a2a75b062db6cc55ff02297f</id>
<content type='text'>
Make `Vec::new` a `const fn`

`RawVec::empty/_in` are a hack. They're there because `if size_of::&lt;T&gt; == 0 { !0 } else { 0 }` is not allowed in `const` yet. However, because `RawVec` is unstable, the `empty/empty_in` constructors can be removed when #49146 is done...
</content>
</entry>
<entry>
<title>Make the fields of RangeInclusive private.</title>
<updated>2018-04-30T13:01:13+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2018-04-05T18:03:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fba903a435ea6e0e3736541cb487586262835e48'/>
<id>urn:sha1:fba903a435ea6e0e3736541cb487586262835e48</id>
<content type='text'>
Added new()/start()/end() methods to RangeInclusive.

Changed the lowering of `..=` to use RangeInclusive::new().
</content>
</entry>
<entry>
<title>heh, logic is hard</title>
<updated>2018-04-29T22:27:17+00:00</updated>
<author>
<name>Mark Mansi</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2018-04-29T22:27:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f9f992379de4a82637ec4bf717ff42f27872bc48'/>
<id>urn:sha1:f9f992379de4a82637ec4bf717ff42f27872bc48</id>
<content type='text'>
</content>
</entry>
<entry>
<title>use const trick</title>
<updated>2018-04-29T22:13:49+00:00</updated>
<author>
<name>Mark Mansi</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2018-04-29T22:13:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e5280e452f194ea7b4066c50b7954e07cb054161'/>
<id>urn:sha1:e5280e452f194ea7b4066c50b7954e07cb054161</id>
<content type='text'>
</content>
</entry>
<entry>
<title>stabilize `#[must_use]` for functions and must-use operators</title>
<updated>2018-04-29T03:32:49+00:00</updated>
<author>
<name>Zack M. Davis</name>
<email>code@zackmdavis.net</email>
</author>
<published>2018-03-11T00:23:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3dbdccc6a9c1ead58325d415381b25c676386c34'/>
<id>urn:sha1:3dbdccc6a9c1ead58325d415381b25c676386c34</id>
<content type='text'>
This is in the matter of RFC 1940 and tracking issue #43302.
</content>
</entry>
</feed>
