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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h

Issue 2860813004: Change TaskQueueImpl to use a Deque with an inline capacity of 8 (Closed)
Patch Set: Created 3 years, 7 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 | third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
index 79ef86d7078ecacfe1a027841a6cd76512bbfc07..5a23d3ea5c476eb968aae223bdc0f733e353fb14 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
@@ -320,12 +320,16 @@ class PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
EnqueueOrder sequence_number,
bool nestable);
+ // We reserve an inline capacity of 8 tasks to try and reduce the load on
+ // PartitionAlloc.
+ using TaskDeque = WTF::Deque<Task, 8>;
+
// Extracts all the tasks from the immediate incoming queue and clears it.
// Can be called from any thread.
- WTF::Deque<TaskQueueImpl::Task> TakeImmediateIncomingQueue();
+ TaskDeque TakeImmediateIncomingQueue();
void TraceQueueSize() const;
- static void QueueAsValueInto(const WTF::Deque<Task>& queue,
+ static void QueueAsValueInto(const TaskDeque& queue,
base::TimeTicks now,
base::trace_event::TracedValue* state);
static void QueueAsValueInto(const std::priority_queue<Task>& queue,
@@ -372,12 +376,12 @@ class PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
}
mutable base::Lock immediate_incoming_queue_lock_;
- WTF::Deque<Task> immediate_incoming_queue_;
- WTF::Deque<Task>& immediate_incoming_queue() {
+ TaskDeque immediate_incoming_queue_;
+ TaskDeque& immediate_incoming_queue() {
immediate_incoming_queue_lock_.AssertAcquired();
return immediate_incoming_queue_;
}
- const WTF::Deque<Task>& immediate_incoming_queue() const {
+ const TaskDeque& immediate_incoming_queue() const {
immediate_incoming_queue_lock_.AssertAcquired();
return immediate_incoming_queue_;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698