Skip to content

Hot runtime: choose the automatic worker count from the host #906

Open

Description

@danfry1

Problem

With the hot runtime and no maxWorkers, the worker count is MAX_AUTO_WORKERS = 4 (src/native/memory.mjs:16) on every host. That fits some machines and not others. One adopter's ~400-file suite on an Apple M3 Pro (6 performance + 6 efficiency cores) ran 18% faster with maxWorkers: 6 than with the automatic 4 (43.8 s vs 53.2 s, warm medians of 3). 8 workers was slower than 6 and used ~30% more CPU. Our own Bluesky matrix on a host with 4 performance cores found 4 best. In both cases the fastest count equals the number of performance cores.

Done when

  • The automatic count is derived from the host (for example, performance cores where the OS reports them, with a fallback elsewhere) and still bounded by the memory plan. A unit test covers each source of the count and the fallback.
  • A counted comparison on at least two hosts or core layouts shows the new automatic count is never slower than 4 beyond noise. The deciding numbers are posted on this issue.
  • The banner and the hot-runtime "Workers" docs describe how the count is chosen.

Notes

macOS reports performance cores as hw.perflevel0.physicalcpu. Linux containers report no core classes, so the fallback decides there. Measurements need AC power and a quiet machine.

Activity

  1. added this to the 0.16.0 milestone on Nov 18, 2026
  2. added
    enhancement
    area:hot-runtime
    area:performance
    priority:medium
    on Nov 18, 2026
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

    area:hot-runtimearea:performanceenhancementpriority:medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions