Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Unified Diff: src/heap/mark-compact.cc

Issue 2477733002: [heap] Compute number of pointer update tasks based on available cores. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 7232d80683476c53668185ca0a1249e1cafaa573..284b201c33dd5fd67b775c92f24d7140c2e62691 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3588,9 +3588,11 @@ class PointerUpdateJobTraits {
int NumberOfPointerUpdateTasks(int pages) {
if (!FLAG_parallel_pointer_update) return 1;
- const int kMaxTasks = 4;
+ const int available_cores = Max(
+ 1, static_cast<int>(
+ V8::GetCurrentPlatform()->NumberOfAvailableBackgroundThreads()));
const int kPagesPerTask = 4;
- return Min(kMaxTasks, (pages + kPagesPerTask - 1) / kPagesPerTask);
+ return Min(available_cores, (pages + kPagesPerTask - 1) / kPagesPerTask);
}
template <PointerDirection direction>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698