#include <stddef.h>
#include <atomic>
#include <optional>
#include <utility>
#include <vector>
#include "base/containers/queue.h"
#include "base/containers/stack.h"
#include "base/functional/callback_helpers.h"
#include "base/synchronization/lock.h"
#include "base/task/post_job.h"
#include "base/task/thread_pool.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"
namespace base {
namespace {
constexpr char kMetricPrefixJob[] = …;
constexpr char kMetricWorkThroughput[] = …;
constexpr char kStoryNoOpNaive[] = …;
constexpr char kStoryBusyWaitNaive[] = …;
constexpr char kStoryNoOpAtomic[] = …;
constexpr char kStoryNoOpAtomicDisrupted[] = …;
constexpr char kStoryBusyWaitAtomic[] = …;
constexpr char kStoryBusyWaitAtomicDisrupted[] = …;
constexpr char kStoryNoOpDynamic[] = …;
constexpr char kStoryNoOpDynamicDisrupted[] = …;
constexpr char kStoryBusyWaitDynamic[] = …;
constexpr char kStoryBusyWaitDynamicDisrupted[] = …;
constexpr char kStoryNoOpLoopAround[] = …;
constexpr char kStoryNoOpLoopAroundDisrupted[] = …;
constexpr char kStoryBusyWaitLoopAround[] = …;
constexpr char kStoryBusyWaitLoopAroundDisrupted[] = …;
perf_test::PerfResultReporter SetUpReporter(const std::string& story_name) { … }
class IndexGenerator { … };
struct WorkItem { … };
class WorkList { … };
RepeatingCallback<void(size_t)> BusyWaitCallback(TimeDelta delta) { … }
void DisruptivePostTasks(size_t task_count, TimeDelta delay) { … }
class JobPerfTest : public testing::Test { … };
}
TEST_F(JobPerfTest, NoOpWorkNaiveAssignment) { … }
TEST_F(JobPerfTest, BusyWaitNaiveAssignment) { … }
TEST_F(JobPerfTest, NoOpWorkAtomicAssignment) { … }
TEST_F(JobPerfTest, NoOpDisruptedWorkAtomicAssignment) { … }
TEST_F(JobPerfTest, BusyWaitAtomicAssignment) { … }
TEST_F(JobPerfTest, BusyWaitDisruptedWorkAtomicAssignment) { … }
TEST_F(JobPerfTest, NoOpWorkDynamicAssignment) { … }
TEST_F(JobPerfTest, NoOpDisruptedWorkDynamicAssignment) { … }
TEST_F(JobPerfTest, BusyWaitWorkDynamicAssignment) { … }
TEST_F(JobPerfTest, BusyWaitDisruptedWorkDynamicAssignment) { … }
TEST_F(JobPerfTest, NoOpWorkLoopAround) { … }
TEST_F(JobPerfTest, NoOpDisruptedWorkLoopAround) { … }
TEST_F(JobPerfTest, BusyWaitWorkLoopAround) { … }
TEST_F(JobPerfTest, BusyWaitDisruptedWorkLoopAround) { … }
}