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

Expose node-gyp's jobs For Multi Core Building #303

Open
dsanders11 opened this issue Jun 5, 2019 · 0 comments
Open

Expose node-gyp's jobs For Multi Core Building #303

dsanders11 opened this issue Jun 5, 2019 · 0 comments

Comments

@dsanders11
Copy link
Member

Currently electron-rebuild uses a single node-gyp job (the default) so it can only use a single core. With multi-core systems (should be almost all these days) this leaves a lot of performance on the table and results in slow builds.

The fix is easy enough, jobs N simply needs to be passed to node-gyp. I'll gladly make a PR, but wanted to discuss how it should look before putting any time into it.

Tested the change manually and on a rebuild on a Raspberry Pi, build time went from 1409 seconds to 693 seconds because it was able to use more cores. In theory it should have only taken ~350 seconds but I think it was I/O limited due to a slow disk.

The most obvious approach for exposing this option would be to add -j, --jobs Number of parallel jobs to use as an option for electron-rebuild, and pass this value to node-gyp. This would retain current behavior of only using a single job, but allow configuring more.

The downside to this approach is there's no automatic performance gain, people need to be aware of the flag and use it. There is the option to pass max to node-gyp which will set jobs to the number of cores available. If this was the default for electron-rebuild the performance boost would be available out of the box.

@MarshallOfSound, thoughts?

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

1 participant