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

NW Executable File Size: make a lightweight standalone executable #3955

Closed
loretoparisi opened this Issue Nov 5, 2015 · 6 comments

Comments

Projects
None yet
6 participants
@loretoparisi
Copy link

loretoparisi commented Nov 5, 2015

The executable file size for

v0.12.3: (Jul 31, 2015, based off of IO.js v1.2.0, Chromium 41.0.2272.76)

are

Windows nw.exe 61MB
Linux nw 74MB
MacOS nwjsFramework 74,1MB

This means, that making a simple app package without any other external resource, generates a package that is about 70MB up to 100MB for MacOS .app like:

macbookproloreto:Contents admin$ ls -l
total 16
drwxr-xr-x@ 7 admin  staff   238  4 Nov 18:39 Frameworks
-rw-r--r--@ 1 admin  staff  2779  4 Nov 21:18 Info.plist
drwxr-xr-x@ 3 admin  staff   102  4 Nov 18:43 MacOS
-rw-r--r--@ 1 admin  staff     8 29 Lug 14:45 PkgInfo
drwxr-xr-x@ 8 admin  staff   272  5 Nov 13:00 Resources
macbookproloreto:Contents admin$ du -h -d1
 89M    ./Frameworks
 12K    ./MacOS
176K    ./Resources
 89M    .
macbookproloreto:Contents admin$ 

where I just have

macbookproloreto:Resources admin$ cd app.nw/
macbookproloreto:app.nw admin$ pwd
/Developmemt/Web/NodeWebKit/my-apps/example-app.app/Contents/Resources/app.nw
macbookproloreto:app.nw admin$ ls -l
total 16
-rw-r--r--  1 admin  staff  1275  5 Nov 13:14 index.html
-rw-r--r--  1 admin  staff   447  4 Nov 21:53 package.json
macbookproloreto:app.nw admin$ 

Is there any way to compile Chromium in order to strip down unnecessary libraries, etc to shrink it, let's say a light build like 20-30MB for the NW standalone?

Thank you.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@loretoparisi loretoparisi changed the title Executable File Size NW Executable File Size: make a lightweight standalone executable Nov 5, 2015

@puzzud

This comment has been minimized.

Copy link

puzzud commented Nov 5, 2015

@loretoparisi, as far as I know, the newest development of NW JS (the v0.13 alphas) is geared at solving that problem by providing 3 different build types: SDK (one with debugger / Chromium developer tools), normal, and then one with native client support.

As far as I know, the SDK version is most like what is available in 0.12.3, which adds a bit of bloat.

My experience is that the resulting NW JS builds compress down fairly well though; where I'm seeing something like 80 MB down to about 30 MB.

@loretoparisi

This comment has been minimized.

Copy link
Author

loretoparisi commented Nov 5, 2015

@puzzud Ok, so I'm going to try the 0.13 alpha5. I confirm that compressing the app it is downsized to about 30MB, but how do you managed that, I mean it's ok to distribute, and you did like a native installer that unzip everything?

@ColonelBundy

This comment has been minimized.

Copy link

ColonelBundy commented Nov 5, 2015

Using nwbuilder I get a stable 49.1% compression, 77mb -> 38mb. I would also like to see a more distributel friendly version.

@ghostoy

This comment has been minimized.

Copy link
Member

ghostoy commented Nov 6, 2015

I tried with UPX which compresses nw13-alpha3 sdk for win32 from 66M to 23M. But a known issue is that UPX will strip off all the debug info from executables.

@loretoparisi

This comment has been minimized.

Copy link
Author

loretoparisi commented Nov 9, 2015

@makkesk8 thank you, I think I will try this way, since I need first a binary that is a stripped down version of the current one. Then as soon as I get a smaller executable, the compressed package will be distributed with a mac installer (if on mac). I will post here my results.

@ColonelBundy

This comment has been minimized.

Copy link

ColonelBundy commented Nov 9, 2015

@loretoparisi That result wasn't 100% accurate since I have a gulp script that builds it with nw-builder then to NSIS so total package with installer is 38 mb, Me saying this doesn't really matter since the installer is just +/- a mb or two. But you should see a similar result :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.