Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/six-threads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@doc-kit/core': minor
---

Builds use up to 6 threads by default, instead of 4: with generators streaming into each other, more threads now pay off. On the Node.js API docs, the site build is ~15% faster at 6 threads than at 4, for ~20% more memory, while 8 threads were no faster than 6. `--threads` still sets any count.
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ these for that generator alone, except `markdown`, which it adds to.
Top-level, alongside `target` and `global`:

- `threads` {number} Worker threads used for generation. Defaults to your
CPU count. Each worker's heap is limited to 512MB; to raise the limit, run
CPU count, up to 6. Each worker's heap is limited to 512MB; to raise the limit, run
Node.js with `--max-old-space-size` (directly or through `NODE_OPTIONS`).
- `chunkSize` {number} Items processed per worker thread. **Default:** `10`.

Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/threading/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
/**
* The default `threads` ceiling. Each worker holds a heap of its own, with the
* libraries and the pages it is working on, so past a few threads memory, not
* CPU, is what runs out. `--threads` raises it.
* CPU, is what runs out: on the Node.js docs, 8 threads were no faster than 6,
* for ~15% more memory. `--threads` raises it.
*/
export const DEFAULT_MAX_THREADS = 4;
export const DEFAULT_MAX_THREADS = 6;

/**
* The heap size limit of each worker thread (V8's old space), in MB. V8 lets a
Expand Down
Loading