Skip to content

perf(concurrency): use safe auto worker limits by default - #184

Merged
luojiyin1987 merged 2 commits into
masterfrom
perf/safe-auto-threads-default
Sep 1, 2026
Merged

perf(concurrency): use safe auto worker limits by default#184
luojiyin1987 merged 2 commits into
masterfrom
perf/safe-auto-threads-default

Conversation

@luojiyin1987

Copy link
Copy Markdown
Contributor

Summary

  • Make an omitted --threads option use auto.
  • Cap auto workers at 4 for files below 1 MiB.
  • Keep the existing caps of 2 and 1 for larger files.
  • Let explicit numeric values override all automatic caps.
  • Show small-file limits in development diagnostics.
  • Document the default worker limits in the README.

Benchmark basis

The memory benchmark matrix supports a four-worker small-file cap.

At 900 KiB, four workers used about 2.31 GiB median peak RSS.
Eight workers used about 3.92 GiB median peak RSS.

At 1023 KiB, four workers used about 2.82 GiB median peak RSS.
Eight workers used about 4.03 GiB median peak RSS.

The default policy stays conservative.
Users can pass --threads N when they accept the resource cost.

Validation

  • npm run lint
  • npm test -- --runInBand
  • node ./lib/src/lint-md.js README.md
  • 26 test suites passed.
  • 223 tests passed.

Redactions

None.

@luojiyin1987
luojiyin1987 merged commit 76401f8 into master Sep 1, 2026
6 checks passed
@luojiyin1987
luojiyin1987 deleted the perf/safe-auto-threads-default branch September 1, 2026 11:36
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

Successfully merging this pull request may close these issues.

1 participant