简体   繁体   English

节点:从源代码构建到二进制分发

[英]Node: building from source vs binary distribution

I have downloaded node 0.10.31 source and built on my Linux machine using same steps mentioned in wiki. 我已经下载了节点0.10.31的源代码,并使用Wiki中提到的相同步骤在Linux计算机上构建了该文件。 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 900kb difference (built from source is bigger). 构建成功,但是当我比较bin / node文件大小与从二进制文件下载的文件大小时,大约有900kb的差异(从源构建的文件更大)。

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

Note: Already posted in node.js groups, sorry for the cross post. 注意:已经发布在node.js组中,对于交叉发布很抱歉。 Thanks 谢谢

You can try and strip out debugging symbols. 您可以尝试删除调试符号。 Eg, 例如,

$ strip node

Debugging symbols are pieces of information embedded in an object file, and useful for debugging purposes. 调试符号是嵌入在目标文件中的信息,对于调试目的很有用。 Unfortunately, they take up space in the file, so if you do not plan debugging the node interpreter itself you could get rid of them. 不幸的是,它们占用了文件中的空间,因此,如果您不打算调试node解释器本身,则可以摆脱它们。

Moreover, please check out strip 's manual page for a full list of choices when discarding symbols from object files. 此外,在丢弃目标文件中的符号时,请查看strip的手册页以获取选择的完整列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM