Skip to content

child_process.spawn is considerably slower in Node 12+ #41529

@ion-dev

Description

@ion-dev

Version

Node v12+

Platform

MacOS (Big Sur)

Summary

We've discovered an issue with 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).

The issue appears to be related to the Node version - Here's an example app, with instructions, to demonstrate:
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 --

This bug only occurs on macOS running Big Sur AND only with Electron 12+. I tested on Windows 10 and macOS running Mojave and could not replicate. Electron 11 and lower are also fine.

To summarise, this delay only occurs on macOS running Big Sur with Electron 12 and greater.

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.performanceIssues and PRs related to the performance of Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions