You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Offloading expensive computations to other processes and cores using spawn or exec blocks the main thread for significant portions of time. Obviously the spawned process is not blocking node's event loop while it is running, but the act of spawning the process within node seems to be expensive and blocks. When dealing with a high number of concurrent spawns, the major bottleneck is the node event loop blocking while trying to create child processes.
I noticed this by spawning hundreds of concurrent child processes and noting that only 1 CPU core was reaching 90+% utilization. The other cores running the child processes had less than 50% utilization.
Is there a more efficient way to spawn child processes than what is currently done in node? Or is there a way to spawn processes on a background node thread instead of blocking the main thread?