Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-ipfs binary is too large #1855

Closed
caioalonso opened this issue Oct 18, 2015 · 6 comments
Closed

go-ipfs binary is too large #1855

caioalonso opened this issue Oct 18, 2015 · 6 comments

Comments

@caioalonso
Copy link
Contributor

Seeing as we are gearing up towards self-hosting releases and autoupdating them, I think it would be interesting to reduce the ipfs binary size.

Go is not compatible by default with upx, but https://github.com/pwaller/goupx fixes that. Maybe we could use it?

A preliminary test with the code in master gives me a 75% reduction in binary size:

$ du -h ipfs
24M     ipfs
$ goupx ipfs
(...)
$ du -h ipfs
6.1M    ipfs

And using the --strip-binary option, even more:

$ du -h ipfs
24M     ipfs
$ goupx --strip-binary ipfs
(...)
$ du -h ipfs
4.5M    ipfs
@whyrusleeping
Copy link
Member

what is being removed? Go's binaries are large because they are statically compiled. I assume that all of that space is code, and I was also under the assumption that the compiler removed unused code.

I'm skeptical that you can get such a reduction in size without any adverse side effects.

@jbenet
Copy link
Member

jbenet commented Oct 18, 2015

I suspect there's a ton from debugging symbols.


Sent from Mailbox

On Sun, Oct 18, 2015 at 10:31 AM, Caio Alonso notifications@github.com
wrote:

Seeing as we are gearing up towards self-hosting releases and autoupdating them, I think it would be interesting to reduce the ipfs binary size.
Go is not compatible by default with upx, but https://github.com/pwaller/goupx fixes that. Maybe we could use it?
A preliminary test with the code in master gives me a 75% reduction in binary size:

$ du -h ipfs
24M     ipfs
$ goupx ipfs
(...)
$ du -h ipfs
6.1M    ipfs

Reply to this email directly or view it on GitHub:
#1855

@whyrusleeping
Copy link
Member

well if we remove those, then all the panics will be illegible and useless for debugging anything. (if that is in fact whats taking up all the space)

@caioalonso
Copy link
Contributor Author

@whyrusleeping there's some discussion about this here: golang/go#6853

@ghost
Copy link

ghost commented Oct 19, 2015

Wow, that's some weird copyright header! https://github.com/pwaller/goupx/blob/master/hemfix/hemfix.go

All rights reserved, based on code found somewhere, and GPL! :)

@Kubuxu
Copy link
Member

Kubuxu commented May 31, 2016

I close it as #2097 is more developed.

The goupx is no longer needed in case of Go1.6

@Kubuxu Kubuxu closed this as completed May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants