chromium/base/task/thread_pool/thread_pool_perftest.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/task/thread_pool.h"

#include <stddef.h>

#include <atomic>
#include <memory>
#include <optional>
#include <vector>

#include "base/barrier_closure.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/threading/simple_thread.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"

namespace base {
namespace internal {

namespace {

constexpr char kMetricPrefixThreadPool[] =;
constexpr char kMetricPostTaskThroughput[] =;
constexpr char kMetricRunTaskThroughput[] =;
constexpr char kMetricNumTasksPosted[] =;
constexpr char kStoryBindPostThenRunNoOp[] =;
constexpr char kStoryPostThenRunNoOp[] =;
constexpr char kStoryPostThenRunNoOpManyThreads[] =;
constexpr char kStoryPostThenRunNoOpMoreThanRunningThreads[] =;
constexpr char kStoryPostRunNoOp[] =;
constexpr char kStoryPostRunNoOpManyThreads[] =;
constexpr char kStoryPostRunBusyManyThreads[] =;

perf_test::PerfResultReporter SetUpReporter(const std::string& story_name) {}

enum class ExecutionMode {};

// A thread that waits for the caller to signal an event before proceeding to
// call action.Run().
class PostingThread : public SimpleThread {};

class ThreadPoolPerfTest : public testing::Test {};

}  // namespace

TEST_F(ThreadPoolPerfTest, BindPostThenRunNoOpTasks) {}

TEST_F(ThreadPoolPerfTest, PostThenRunNoOpTasks) {}

TEST_F(ThreadPoolPerfTest, PostThenRunNoOpTasksManyThreads) {}

TEST_F(ThreadPoolPerfTest, PostThenRunNoOpTasksMorePostingThanRunningThreads) {}

TEST_F(ThreadPoolPerfTest, PostRunNoOpTasks) {}

TEST_F(ThreadPoolPerfTest, PostRunNoOpTasksManyThreads) {}

TEST_F(ThreadPoolPerfTest, PostRunBusyTasksManyThreads) {}

}  // namespace internal
}  // namespace base