-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pr/cross-record
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git a/node_modules/jsii-rosetta/lib/commands/extract.js b/node_modules/jsii-rosetta/lib/commands/extract.js | ||
index e695ea9..539038e 100644 | ||
--- a/node_modules/jsii-rosetta/lib/commands/extract.js | ||
+++ b/node_modules/jsii-rosetta/lib/commands/extract.js | ||
@@ -104,7 +104,8 @@ exports.singleThreadedTranslateAll = singleThreadedTranslateAll; | ||
async function workerBasedTranslateAll(worker, snippets, includeCompilerDiagnostics) { | ||
// Use about half the advertised cores because hyperthreading doesn't seem to help that | ||
// much (on my machine, using more than half the cores actually makes it slower). | ||
- const N = Math.max(1, Math.ceil(os.cpus().length / 2)); | ||
+ // Cap to a reasonable top-level limit to prevent thrash on machines with many, many cores. | ||
+ const N = Math.min(16, Math.max(1, Math.ceil(os.cpus().length / 2))); | ||
const snippetArr = Array.from(snippets); | ||
const groups = util_1.divideEvenly(N, snippetArr); | ||
logging.info(`Translating ${snippetArr.length} snippets using ${groups.length} workers`); |