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

Unified Diff: content/renderer/render_process_impl.cc

Issue 2681523002: Increase the number of TaskScheduler foreground threads in renderers. (Closed)
Patch Set: self-review Created 3 years, 10 months 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: content/renderer/render_process_impl.cc
diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc
index db042b903f1748a8b4ff9fbb4e92f0b3bb048555..abb54655863198d93a2eabcf1c80dbbb18bebae8 100644
--- a/content/renderer/render_process_impl.cc
+++ b/content/renderer/render_process_impl.cc
@@ -93,7 +93,14 @@ GetDefaultSchedulerWorkerPoolParams() {
constexpr int kMaxNumThreadsInForegroundPoolUpperBound = 4;
constexpr double kMaxNumThreadsInForegroundPoolCoresMultiplier = 1;
constexpr int kMaxNumThreadsInForegroundPoolOffset = 0;
- constexpr size_t kMaxNumThreadsInForegroundFileIOPool = 1;
+
+ // V8Platform::CallOnBackgroundThread() posts foreground blocking tasks. It
+ // expects to have as many threads as cores available for these tasks.
+ constexpr int kMaxNumThreadsInForegroundFileIOPoolLowerBound = 2;
+ constexpr int kMaxNumThreadsInForegroundFileIOPoolUpperBound = 128;
+ constexpr double kMaxNumThreadsInForegroundFileIOPoolCoresMultiplier = 1;
+ constexpr int kMaxNumThreadsInForegroundFileIOPoolOffset = 0;
+
constexpr auto kSuggestedReclaimTime = base::TimeDelta::FromSeconds(30);
std::vector<base::SchedulerWorkerPoolParams> params_vector;
@@ -113,10 +120,15 @@ GetDefaultSchedulerWorkerPoolParams() {
kMaxNumThreadsInForegroundPoolCoresMultiplier,
kMaxNumThreadsInForegroundPoolOffset),
kSuggestedReclaimTime);
- params_vector.emplace_back("RendererForegroundFileIO", ThreadPriority::NORMAL,
- StandbyThreadPolicy::LAZY,
- kMaxNumThreadsInForegroundFileIOPool,
- kSuggestedReclaimTime);
+ params_vector.emplace_back(
+ "RendererForegroundFileIO", ThreadPriority::NORMAL,
+ StandbyThreadPolicy::LAZY,
+ base::RecommendedMaxNumberOfThreadsInPool(
robliao 2017/02/06 20:07:51 Is using RecommendedMax... better than a std::min(
fdoray 2017/02/06 20:14:03 Done.
+ kMaxNumThreadsInForegroundFileIOPoolLowerBound,
+ kMaxNumThreadsInForegroundFileIOPoolUpperBound,
+ kMaxNumThreadsInForegroundFileIOPoolCoresMultiplier,
+ kMaxNumThreadsInForegroundFileIOPoolOffset),
+ kSuggestedReclaimTime);
DCHECK_EQ(WORKER_POOL_COUNT, params_vector.size());
return params_vector;
}
« 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