Skip to content

Process creation on Windows is needlessly serialised #381

Open

Description

@sheaf

When close_fds = True, we can explicitly pass the processes that the child is allowed to inherit. This completely avoids the problem of GHC bug #2650 that made locking necessary.

In a microbenchmark, spawning 200 processes with close_fds = True concurrently takes about 1.5s on my machine, with over 40% of the time (0.7s) wasted due to waiting on the lock.

While working on speeding up GHC's downsweep pass, I found that on Windows a lot of time was spent on process spawning (e.g. to run the C preprocessor), and that this serialisation was a significant component of that. In a rebuild of the vulkan package, the downsweep pass spawns a huge amount of subprocesses, and removing this locking takes the time spent in downsweep from 31s to 27s (4s total timesave).

Activity

  1. added a commit that references this issue on Aug 31, 2026
    7faa30b
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions