Skip to content

Commit 73d3d2f

Browse files
committed
Merge pull request #108969 from adamscott/patch-the-editor
[Web] Fix the editor `{godot,emscripten}PoolSize` config values
2 parents 0c595da + 1777be4 commit 73d3d2f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

misc/dist/html/editor.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,10 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
674674
}
675675
}
676676

677+
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
678+
// We need at least 6 free threads from the pool to start the editor.
679+
// At least 4 more will be reserved for the godot thread pool (3 is the bare minimum with the multithreaded variant of the servers).
680+
const concurrency = clamp(navigator.hardwareConcurrency ?? 1, 12, 24);
677681
const editorConfig = {
678682
'unloadAfterInit': false,
679683
'onProgress': function progressFunction(current, total) {
@@ -700,6 +704,8 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
700704
},
701705
'onExecute': Execute,
702706
'persistentPaths': persistentPaths,
707+
'emscriptenPoolSize': concurrency,
708+
'godotPoolSize': Math.floor(concurrency / 3), // Ensures at least 4 threads for the pool (see above).
703709
};
704710
editor = new Engine(editorConfig);
705711

0 commit comments

Comments
 (0)