Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
dart::Benchmark Class Reference

#include <benchmark_test.h>

Public Types

typedef void() RunEntry(Benchmark *benchmark)
 

Public Member Functions

 Benchmark (RunEntry *run, const char *name, const char *score_kind)
 
const char * name () const
 
const char * score_kind () const
 
void set_score (int64_t value)
 
int64_t score () const
 
Isolateisolate () const
 
void Run ()
 
void RunBenchmark ()
 
void CreateIsolate ()
 

Static Public Member Functions

static void RunAll (const char *executable)
 
static void SetExecutable (const char *arg)
 
static const char * Executable ()
 

Detailed Description

Definition at line 54 of file benchmark_test.h.

Member Typedef Documentation

◆ RunEntry

typedef void() dart::Benchmark::RunEntry(Benchmark *benchmark)

Definition at line 56 of file benchmark_test.h.

Constructor & Destructor Documentation

◆ Benchmark()

dart::Benchmark::Benchmark ( RunEntry run,
const char *  name,
const char *  score_kind 
)
inline

Definition at line 58 of file benchmark_test.h.

59 : run_(run),
60 name_(name),
61 score_kind_(score_kind),
62 score_(0),
63 isolate_(nullptr),
64 next_(nullptr) {
65 if (first_ == nullptr) {
66 first_ = this;
67 } else {
68 tail_->next_ = this;
69 }
70 tail_ = this;
71 }
const char * name() const
const char * score_kind() const
Definition run.py:1

Member Function Documentation

◆ CreateIsolate()

void dart::Benchmark::CreateIsolate ( )
inline

Definition at line 87 of file benchmark_test.h.

87 {
88 isolate_ = TestCase::CreateTestIsolate();
89 EXPECT(isolate_ != nullptr);
90 }
#define EXPECT(type, expectedAlignment, expectedSize)
static Dart_Isolate CreateTestIsolate(const char *name=nullptr, void *isolate_group_data=nullptr, void *isolate_data=nullptr)
Definition unit_test.cc:139

◆ Executable()

static const char * dart::Benchmark::Executable ( )
inlinestatic

Definition at line 85 of file benchmark_test.h.

85{ return executable_; }

◆ isolate()

Isolate * dart::Benchmark::isolate ( ) const
inline

Definition at line 78 of file benchmark_test.h.

78{ return reinterpret_cast<Isolate*>(isolate_); }

◆ name()

const char * dart::Benchmark::name ( ) const
inline

Definition at line 74 of file benchmark_test.h.

74{ return name_; }

◆ Run()

void dart::Benchmark::Run ( )
inline

Definition at line 80 of file benchmark_test.h.

80{ (*run_)(this); }

◆ RunAll()

void Benchmark::RunAll ( const char *  executable)
static

Definition at line 33 of file benchmark_test.cc.

33 {
34 SetExecutable(executable);
35 Benchmark* benchmark = first_;
36 while (benchmark != nullptr) {
37 benchmark->RunBenchmark();
38 benchmark = benchmark->next_;
39 }
40}
static void SetExecutable(const char *arg)

◆ RunBenchmark()

void Benchmark::RunBenchmark ( )

Definition at line 73 of file run_vm_tests.cc.

73 {
74 if ((run_filter == kAllBenchmarks) ||
75 (strcmp(run_filter, this->name()) == 0)) {
76 this->Run();
77 Syslog::Print("%s(%s): %" Pd64 "\n", this->name(), this->score_kind(),
78 this->score());
80 } else if (run_filter == kList) {
81 Syslog::Print("%s Pass\n", this->name());
83 }
84}
int64_t score() const
static void Print(const char *format,...) PRINTF_ATTRIBUTE(1
static int run_matches
static const char * run_filter
static constexpr const char * kAllBenchmarks
static constexpr const char * kList
#define Pd64
Definition globals.h:416

◆ score()

int64_t dart::Benchmark::score ( ) const
inline

Definition at line 77 of file benchmark_test.h.

77{ return score_; }

◆ score_kind()

const char * dart::Benchmark::score_kind ( ) const
inline

Definition at line 75 of file benchmark_test.h.

75{ return score_kind_; }

◆ set_score()

void dart::Benchmark::set_score ( int64_t  value)
inline

Definition at line 76 of file benchmark_test.h.

76{ score_ = value; }
uint8_t value

◆ SetExecutable()

static void dart::Benchmark::SetExecutable ( const char *  arg)
inlinestatic

Definition at line 84 of file benchmark_test.h.

84{ executable_ = arg; }

The documentation for this class was generated from the following files: