Commit 664e3a5f authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Add a runtime feature flag for optimizing workers for performance

Currently workers send IsolateInBackgroundNotification to V8 signalling
that memory usage is more important than performance. However there are
use cases where workers are used for user visible computation and thus
are performance critical.

This flag will allows us to do a Finch experiment to see how overall
memory metrics are impacted.

Bug: 1049132
Change-Id: I99e26f36ff10a864a05eb6f30b5d8a62e99e3dc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088515
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747632}
parent 92034a4d
...@@ -83,8 +83,13 @@ void WorkerBackingThread::InitializeOnBackingThread( ...@@ -83,8 +83,13 @@ void WorkerBackingThread::InitializeOnBackingThread(
V8PerIsolateData::From(isolate_)->SetThreadDebugger( V8PerIsolateData::From(isolate_)->SetThreadDebugger(
std::make_unique<WorkerThreadDebugger>(isolate_)); std::make_unique<WorkerThreadDebugger>(isolate_));
// Optimize for memory usage instead of latency for the worker isolate. if (!RuntimeEnabledFeatures::V8OptimizeWorkersForPerformanceEnabled()) {
isolate_->IsolateInBackgroundNotification(); // Optimize for memory usage instead of latency for the worker isolate.
// Service Workers that have the fetch event handler run with the Isolate
// in foreground notification regardless of this configuration.
// See ServiceWorkerGlobalScope::SetFetchHandlerExistence().
isolate_->IsolateInBackgroundNotification();
}
if (startup_data.heap_limit_mode == if (startup_data.heap_limit_mode ==
WorkerBackingThreadStartupData::HeapLimitMode::kIncreasedForDebugging) { WorkerBackingThreadStartupData::HeapLimitMode::kIncreasedForDebugging) {
......
...@@ -1750,6 +1750,10 @@ ...@@ -1750,6 +1750,10 @@
{ {
name: "V8IdleTasks", name: "V8IdleTasks",
}, },
{
name: "V8OptimizeWorkersForPerformance",
status: "experimental",
},
{ {
// Whether a video element should automatically play fullscreen unless // Whether a video element should automatically play fullscreen unless
// 'playsinline' is set. // 'playsinline' is set.
......
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