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

child_process.spawn is considerably slower in Electron 12+ #32480

Closed
ion-dev opened this issue Jan 14, 2022 · 9 comments
Closed

child_process.spawn is considerably slower in Electron 12+ #32480

ion-dev opened this issue Jan 14, 2022 · 9 comments

Comments

@ion-dev
Copy link

ion-dev commented Jan 14, 2022

We've discovered an issue with macOS (Big Sur) and Electron 12 and above (Node 14 and above), where spawning a child_process takes considerably longer than Electron 11 and lower (Node 12 and lower).

Here's an example app with instructions to demonstrate the problem:
https://github.com/dev-manager-uk/spawn-delay

After running the app initially, you'll notice the spawn function takes ~10ms.

After upgrading Electron to 12 or higher, you'll notice the spawn function takes ~500ms!

What's changed to cause this and can anything be done about it?

Thanks!

-- UPDATE --

macOS (Big Sur) - Bug exists
macOS (Mojave) - unable to replicate this bug
Windows 10 - unable to replicate this bug

@RaisinTen
Copy link
Member

Related - #26143?

@nornagon
Copy link
Member

#26143 is about a problem with macOS >= Big Sur, but the symptom you're describing makes it seem like it's an issue with a particular Electron version. Would be great if you could take a look at #26143 and let me know if your symptoms match those described!

@ion-dev
Copy link
Author

ion-dev commented Jan 19, 2022

@RaisinTen @nornagon
I've now tested on Windows 10 and macOS running Mojave and cannot replicate!

The delay only occurs on macOS running Big Sur, and only when Electron 12 or greater. Electron 11 and lower are fine!

@RaisinTen
Copy link
Member

In that case, should we close this issue in favour of #26143 as this is a duplicate of that?

@ion-dev
Copy link
Author

ion-dev commented Jan 19, 2022

In that case, should we close this issue in favour of #26143 as this is a duplicate of that?

Perhaps, although I'm seeing normal behaviour using Electron 11 on Big Sur. For me the problem arises after updating to 12+.

@ckerr ckerr closed this as completed Feb 14, 2022
@dreamthen
Copy link

I also encountered this problem, after version 12 using the node main process fork the child process is about 800ms slower.

@dreamthen
Copy link

The result of running the same code on version 11 and version 12+ is that version 12+ is 800 ms slower.

@RaisinTen
Copy link
Member

@dreamthen the libuv patch that fixes the perf regression has been merged and backported to v15, v16, v17 and v18; see #33337, so this shouldn't be an issue anymore if you are on supported versions.

@dreamthen
Copy link

well done~it works.

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

5 participants