Closed
Description
Between rustc 1.19.0-nightly (10d7cb44c 2017-06-18)
and 1.20.0-nightly (445077963 2017-06-20)
I experienced one of my binaries to grow up from 3.4M to 3.7M, which is approx 8.8%. At first I was scared that this was a fallout of my own PR (#42716), but that particular binary didn't use C strings almost at all.
I examined a diff in symbols made with nm
and saw that the binary compiled with 1.20.0-nightly (445077963 2017-06-20)
has a lot more symbols like that:
_<alloc::raw_vec::RawVec<T, A>>::dealloc_buffer
(14 occurences)_alloc::allocator::Alloc::alloc_array
(57 occurences)_alloc::allocator::Alloc::realloc_array
(28 occurences)_core::ptr::drop_in_place
(mighty 138 new occurences)
This leads us to the possibility that #42313 is the culprit.
Current Situation
There are 2 reproducers, and I need to make some measurements:
Activity
leonardo-m commentedon Jun 21, 2017
The blowup of binary size is the minor difference. The main difference is in compilation times and run-times of that resulting binary, that are quite worse.
Mark-Simulacrum commentedon Jun 22, 2017
cc @alexcrichton @pnkfelix
alexcrichton commentedon Jun 22, 2017
@alexbool can you enable us to reproduce this? I can investigate in parallel but bug reports tend to be much more readily fixable if there's a way to reproduce what caused the bug report!
alexcrichton commentedon Jun 22, 2017
Looks like this isn't a regression for "hello world", or likely just "in the noise"
alexbool commentedon Jun 22, 2017
I'll try to make a minimal reproducible example today or later this week
alexcrichton commentedon Jun 25, 2017
@alexbool any updates on this?
@leonardo-m or @hinaria do y'all have examples of this causing a size increase?
alexbool commentedon Jun 25, 2017
Unfortunately didn't have much time to dig into this. Will try as soon as I have possibility.
pnkfelix commentedon Jun 27, 2017
Here is a test case that may serve for exhibiting the space increase that @alexbool observed around this time.
(Or at least, on my Mac, building without optimizations, I am observing a size increase of about 1.08x on the stripped binaries. With optimizations, the size increase is about 1.05x)
Build script:
Results:
pnkfelix commentedon Jun 27, 2017
My previous comment notwithstanding, it would be really great if @alexbool could provide us either with their original test case or a somewhat reduced version of it, since it is entirely possible that my (strawman) object size microbenchmark does not actually reflect the real issues that are underpinning the size increase that @alexbool is observing.
leonardo-m commentedon Jun 27, 2017
@alexcrichton, a little increase in binary size is not important to me. But I am seeing significant increases in the run-time of the binary. I've filed a different issue but the cause could be the same:
#42935
68 remaining items