mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
[Web] Fix the editor {godot,emscripten}PoolSize
config values
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
This commit is contained in:
parent
967e2d499a
commit
1777be4444
1 changed files with 6 additions and 0 deletions
6
misc/dist/html/editor.html
vendored
6
misc/dist/html/editor.html
vendored
|
@ -674,6 +674,10 @@ function startEditor(zip) {
|
|||
}
|
||||
}
|
||||
|
||||
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
||||
// We need at least 6 free threads from the pool to start the editor.
|
||||
// At least 4 more will be reserved for the godot thread pool (3 is the bare minimum with the multithreaded variant of the servers).
|
||||
const concurrency = clamp(navigator.hardwareConcurrency ?? 1, 12, 24);
|
||||
const editorConfig = {
|
||||
'unloadAfterInit': false,
|
||||
'onProgress': function progressFunction(current, total) {
|
||||
|
@ -700,6 +704,8 @@ function startEditor(zip) {
|
|||
},
|
||||
'onExecute': Execute,
|
||||
'persistentPaths': persistentPaths,
|
||||
'emscriptenPoolSize': concurrency,
|
||||
'godotPoolSize': Math.floor(concurrency / 3), // Ensures at least 4 threads for the pool (see above).
|
||||
};
|
||||
editor = new Engine(editorConfig);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue