#include <memory>
#include <string>
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"
#include "third_party/blink/renderer/platform/heap/thread_state_scopes.h"
#include "third_party/blink/renderer/platform/heap/trace_traits.h"
namespace blink {
namespace {
class AllocationPerfTest : public TestSupportingGC { … };
class TinyObject final : public GarbageCollected<TinyObject> { … };
class LargeObject final : public GarbageCollected<LargeObject> { … };
template <typename Callback>
base::TimeDelta TimedRun(Callback callback) { … }
constexpr char kMetricPrefix[] = …;
constexpr char kMetricThroughput[] = …;
perf_test::PerfResultReporter SetUpReporter(const std::string& story_name) { … }
}
template <>
struct ThreadingTrait<TinyObject> { … };
template <>
struct ThreadingTrait<LargeObject> { … };
TEST_F(AllocationPerfTest, Allocate10MTiny) { … }
TEST_F(AllocationPerfTest, Allocate10MLarge) { … }
}