Skip to content

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

Closed

Description

@dsanders11

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?

Activity

  1. added a commit that references this issue on Jul 3, 2026
    2d5d8e5
  2. electron-npm-package-publisher commented on Jul 7, 2026

    @electron-npm-package-publisher

    🎉 This issue has been resolved in version 4.2.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions