Jump to page: 1 2
Thread overview
[Issue 14748] Removing std.stdio import causes 2x increase in "Hello, world" program binary filesize
Jun 30, 2015
Walter Bright
Jun 30, 2015
Walter Bright
Jun 30, 2015
Ketmar Dark
Jun 30, 2015
Ketmar Dark
Jun 30, 2015
Ketmar Dark
Jun 30, 2015
Vladimir Panteleev
Jul 01, 2015
Kenji Hara
Jul 01, 2015
Kenji Hara
Jul 21, 2015
Martin Nowak
Jul 21, 2015
Vladimir Panteleev
Jul 22, 2015
Martin Nowak
Jul 22, 2015
Vladimir Panteleev
Jul 22, 2015
Martin Nowak
Jul 22, 2015
Martin Nowak
Aug 01, 2015
Kenji Hara
Aug 04, 2015
Martin Nowak
June 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
On Win32, I get the same exe file size, and 'stream' symbols do not appear in the executable.

--
June 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to Walter Bright from comment #1)
> On Win32, I get the same exe file size, and 'stream' symbols do not appear in the executable.

The file size is 200Kb.

--
June 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #3 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
hm. it seems to pull the whole Phobos in (or at least a great amount of it). i removed "std.stream" from libphobos2.a, the file is smaller (yet still around 800 kb), and now i see other crap there, like "std.path", for example.

it seems that if this bug will be fixed, linux binaries can become lesser in many cases.

--
June 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #4 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
anyway, something is wrong with generated object file. i generated "hello.o" for phobos without PR3443 applied and with PR3443 applied, then linked that object files with "libphobos2.a" WITH PR3443 applied, and got two ELFs with very different sizes (~900 kb and ~400 kb respectively).

so seems that with PR3443 DMD generates an object file which somehow pulls in alot of unnecessary modules. very strange.

--
June 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #5 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
oops. disregard my #4, i'm an idiot and messed link commands.

--
June 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #6 from Vladimir Panteleev <thecybershadow@gmail.com> ---
(In reply to Walter Bright from comment #1)
> On Win32, I get the same exe file size, and 'stream' symbols do not appear in the executable.

The test machine that detected this is running Ubuntu Server 14.04 x64.

--
July 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #7 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to Walter Bright from comment #2)
> (In reply to Walter Bright from comment #1)
> > On Win32, I get the same exe file size, and 'stream' symbols do not appear in the executable.
> 
> The file size is 200Kb.

Also in Win64, PR 3443 does not introduce the binary size difference. The file size is around 350Kb.

--
July 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|All                         |Linux

--- Comment #8 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to Vladimir Panteleev from comment #6)
> The test machine that detected this is running Ubuntu Server 14.04 x64.

Looks like it's a platform-dependent issue.

--
July 21, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@dawg.eu

--- Comment #9 from Martin Nowak <code@dawg.eu> ---
Can you guys please provide exact instructions to reproduce a bug.
I don't get any file size differences for the following program compiled with
2.067.1 vs. 2.068.0-b1 on a linux x64

cat > bug.d << CODE
import std.stdio;

void main()
{
    writeln("Hello");
}
CODE

dmd bug && size bug

----
2.067.1
   text       data        bss        dec        hex    filename
 413016      26440       2320     441776      6bdb0    bug
----
2.068.0-b1
   text       data        bss        dec        hex    filename
 407761      25344       2416     435521      6a541    bug

Same for ld.bfd version 2.24 and ld.gold 1.11

--
July 21, 2015
https://issues.dlang.org/show_bug.cgi?id=14748

--- Comment #10 from Vladimir Panteleev <thecybershadow@gmail.com> ---
(In reply to Martin Nowak from comment #9)
> Can you guys please provide exact instructions to reproduce a bug.

I can reproduce this just fine with Digger, as explained in the original report.

Here is a script that does all the work:

--------------------------------------------------------------
#!/bin/bash

set -eu

cat << EOF > test.d
import std.stdio;

void main()
{
    writeln("Hello, world!");
}
EOF

rm -f results.txt

test() {
    digger build $1
    mkdir -p $1
    cd $1
    ~/Digger/result/bin/dmd -O -inline -release ../test.d
    cd ..
    ls -al $1/test >> results.txt
}

test e2dc1a631d1b0bd3eb751c6b7f6d70cfdc5b40c1
test f1bf3d208546728d433de7b3d53631497846b117

cat results.txt
--------------------------------------------------------------

I just confirmed the results, and verified that this is not due to a corrupted Digger cache or change in build environment.

I can provide an account on the machine this is reproducible on if you like.

--
« First   ‹ Prev
1 2