Commit 54379af9 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Remove fixed limit on number of background tasks

After fixing https://crbug.com/v8/8916, background compilation scales
far beyond 10 threads, especially for TurboFan (where much more work is
parallelizable). Thus, remove the limit of 10 background compilation
tasks, and use all available threads instead.

R=mstarzinger@chromium.org

Bug: v8:8916
Change-Id: I13c30777e3c85b2de7901b5eac3e6a41457a56f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1893348Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64724}
parent 148e5e86
......@@ -641,8 +641,9 @@ DEFINE_BOOL(assume_asmjs_origin, false,
"force wasm decoder to assume input is internal asm-wasm format")
DEFINE_BOOL(wasm_disable_structured_cloning, false,
"disable wasm structured cloning")
DEFINE_INT(wasm_num_compilation_tasks, 10,
"number of parallel compilation tasks for wasm")
DEFINE_INT(wasm_num_compilation_tasks, -1,
"number of parallel compilation tasks for wasm (default of -1 means "
"using all available threads)")
DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false,
"trace wasm native heap events")
DEFINE_BOOL(wasm_write_protect_code_memory, false,
......
......@@ -2200,7 +2200,11 @@ bool AsyncStreamingProcessor::Deserialize(Vector<const uint8_t> module_bytes,
int GetMaxBackgroundTasks() {
if (NeedsDeterministicCompile()) return 0;
int num_worker_threads = V8::GetCurrentPlatform()->NumberOfWorkerThreads();
return std::min(FLAG_wasm_num_compilation_tasks, num_worker_threads);
int flag_limit = FLAG_wasm_num_compilation_tasks;
if (flag_limit >= 0) {
num_worker_threads = std::min(num_worker_threads, flag_limit);
}
return num_worker_threads;
}
CompilationStateImpl::CompilationStateImpl(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment