Node executable size on building from source vs binary downloaded

109 views
Skip to first unread message

Phani Kumar

unread,
Sep 5, 2014, 9:05:32 AM9/5/14
to nod...@googlegroups.com
I have downloaded node 0.10.31 source and built on my Linux machine. The source is just as it is and no changes made at all. The build is successful but when I compare bin/node file size with the one from binary downloaded there is around 800kb difference.

What is the reason?

Did I miss any optimizer or special config? Actually I wanted to use locally build node (after some change) in production. I just don't want to miss some settings here.

My environment:

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)

Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.5 (Santiago)
Release:        6.5
Codename:       Santiago

Thanks

Phani Kumar

unread,
Sep 15, 2014, 5:34:33 PM9/15/14
to nod...@googlegroups.com
any inputs please?

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/b5d5e42f-2227-4b9d-9ea0-31128d2e16ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-Phani

mscdex

unread,
Sep 15, 2014, 7:31:26 PM9/15/14
to nod...@googlegroups.com
On Friday, September 5, 2014 9:05:32 AM UTC-4, Phani Kumar wrote:
I have downloaded node 0.10.31 source and built on my Linux machine. The source is just as it is and no changes made at all. The build is successful but when I compare bin/node file size with the one from binary downloaded there is around 800kb difference.

My guess would be that the pre-compiled Linux binaries on nodejs.org are still built against an earlier version of glibc (I believe I remember this change some time back so that there would be better compatibility with RHEL/CentOS 5.x installations out of the box).

This can be verified by using `file` on both binaries. You will see that the pre-compiled binary was built for kernel 2.6.9, whereas the one you built is likely for kernel 2.6.24 or some such.

Matt

unread,
Sep 15, 2014, 8:38:20 PM9/15/14
to nod...@googlegroups.com
There can be multiple reasons. The "official" binary could be stripped. There could be a different compiler used. All sorts of reasons.

Phani Kumar

unread,
Sep 16, 2014, 12:08:41 AM9/16/14
to nod...@googlegroups.com

I tried stripping also, still it is not coming closer to pre compiled binary.

Is there any performance impact if I use node binary the way I built?

Can somebody send steps to build node the way pre compiled binary is built?

-Phani

mscdex

unread,
Sep 16, 2014, 10:28:07 AM9/16/14
to nod...@googlegroups.com
On Monday, September 15, 2014 8:38:20 PM UTC-4, Matt Sergeant wrote:
There can be multiple reasons. The "official" binary could be stripped. There could be a different compiler used. All sorts of reasons.


The official pre-compiled binaries are not stripped.



On Tuesday, September 16, 2014 12:08:41 AM UTC-4, Phani Kumar wrote:
Is there any performance impact if I use node binary the way I built?

I wouldn't worry about it. Use the pre-compiled one from nodejs.org or use the one you compiled, it doesn't really matter.

Matt

unread,
Sep 16, 2014, 2:07:57 PM9/16/14
to nod...@googlegroups.com

On Tue, Sep 16, 2014 at 12:00 AM, Phani Kumar <pha...@gmail.com> wrote:

Is there any performance impact if I use node binary the way I built?

Doubtful. Possibly the opposite in fact. It's likely better optimised for your system.
Reply all
Reply to author
Forward
0 new messages