- Report CodeSize instead of runtime for benchmarks reporting snapshot sizes.

R=asiva@google.com

Review URL: https://codereview.chromium.org//314383002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37156 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
iposva@google.com
2014-06-10 05:20:52 +00:00
parent d9b73a3e53
commit 551e5f845a
3 changed files with 15 additions and 8 deletions
+2 -1
View File
@@ -47,7 +47,8 @@ void Benchmark::RunBenchmark() {
if ((run_filter == kAllBenchmarks) ||
(strcmp(run_filter, this->name()) == 0)) {
this->Run();
OS::Print("%s(RunTime): %" Pd "\n", this->name(), this->score());
OS::Print("%s(%s): %" Pd "\n",
this->name(), this->score_kind(), this->score());
run_matches++;
} else if (run_filter == kList) {
fprintf(stdout, "%s\n", this->name());
+2 -2
View File
@@ -394,7 +394,7 @@ static uint8_t* malloc_allocator(
}
BENCHMARK(CoreSnapshotSize) {
BENCHMARK_SIZE(CoreSnapshotSize) {
const char* kScriptChars =
"import 'dart:async';\n"
"import 'dart:core';\n"
@@ -422,7 +422,7 @@ BENCHMARK(CoreSnapshotSize) {
}
BENCHMARK(StandaloneSnapshotSize) {
BENCHMARK_SIZE(StandaloneSnapshotSize) {
const char* kScriptChars =
"import 'dart:async';\n"
"import 'dart:core';\n"
+11 -5
View File
@@ -25,11 +25,11 @@ namespace bin {
extern const uint8_t* snapshot_buffer;
}
// The BENCHMARK macro is used for benchmarking a specific functionality
// of the VM
#define BENCHMARK(name) \
// The BENCHMARK macros are used for benchmarking a specific functionality
// of the VM.
#define BENCHMARK_HELPER(name, kind) \
void Dart_Benchmark##name(Benchmark* benchmark); \
static Benchmark kRegister##name(Dart_Benchmark##name, #name); \
static Benchmark kRegister##name(Dart_Benchmark##name, #name, kind); \
static void Dart_BenchmarkHelper##name(Benchmark* benchmark); \
void Dart_Benchmark##name(Benchmark* benchmark) { \
FLAG_heap_growth_space_ratio = 100; \
@@ -40,6 +40,9 @@ extern const uint8_t* snapshot_buffer;
} \
static void Dart_BenchmarkHelper##name(Benchmark* benchmark)
#define BENCHMARK(name) BENCHMARK_HELPER(name, "RunTime")
#define BENCHMARK_SIZE(name) BENCHMARK_HELPER(name, "CodeSize")
inline Dart_Handle NewString(const char* str) {
return Dart_NewStringFromCString(str);
@@ -50,9 +53,10 @@ class Benchmark {
public:
typedef void (RunEntry)(Benchmark* benchmark);
Benchmark(RunEntry* run, const char* name) :
Benchmark(RunEntry* run, const char* name, const char* score_kind) :
run_(run),
name_(name),
score_kind_(score_kind),
score_(0),
isolate_(NULL),
next_(NULL) {
@@ -66,6 +70,7 @@ class Benchmark {
// Accessors.
const char* name() const { return name_; }
const char* score_kind() const { return score_kind_; }
void set_score(intptr_t value) { score_ = value; }
intptr_t score() const { return score_; }
Isolate* isolate() const { return reinterpret_cast<Isolate*>(isolate_); }
@@ -92,6 +97,7 @@ class Benchmark {
RunEntry* const run_;
const char* name_;
const char* score_kind_;
intptr_t score_;
Dart_Isolate isolate_;
Benchmark* next_;