Skip to content

Commit 821177e

Browse files
committed
testing with more workers
1 parent fd05490 commit 821177e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/generate-md-exports.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {selectAll} from 'hast-util-select';
66
import {createHash} from 'node:crypto';
77
import {createReadStream, createWriteStream, existsSync} from 'node:fs';
88
import {mkdir, opendir, readFile, rm, writeFile} from 'node:fs/promises';
9-
// import {cpus} from 'node:os';
9+
import {cpus} from 'node:os';
1010
import * as path from 'node:path';
1111
import {compose, Readable} from 'node:stream';
1212
import {text} from 'node:stream/consumers';
@@ -95,8 +95,8 @@ async function createWork() {
9595
await mkdir(CACHE_DIR, {recursive: true});
9696
}
9797

98-
// On a 16-core machine, 8 workers were optimal (and slightly faster than 16)
99-
const numWorkers = 2;
98+
// We are currently on Enhanced Builds in Vercel which gives us 8 cores, here we'll use half.
99+
const numWorkers = Math.max(Math.floor(cpus().length / 2), 2);
100100
const workerTasks = new Array(numWorkers).fill(null).map(() => []);
101101

102102
let existingFilesOnR2 = null;

0 commit comments

Comments
 (0)