2012-04-21 01:36:23 +00:00
|
|
|
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
2012-05-01 22:15:26 +00:00
|
|
|
#include "vm/benchmark_test.h"
|
|
|
|
|
2013-05-22 16:07:25 +00:00
|
|
|
#include "bin/builtin.h"
|
2012-05-01 22:15:26 +00:00
|
|
|
#include "bin/file.h"
|
2016-02-04 17:18:31 +00:00
|
|
|
#include "bin/isolate_data.h"
|
2017-08-15 00:02:22 +00:00
|
|
|
#include "bin/process.h"
|
2012-05-01 22:15:26 +00:00
|
|
|
|
2012-04-25 00:35:15 +00:00
|
|
|
#include "platform/assert.h"
|
2014-04-02 17:39:32 +00:00
|
|
|
#include "platform/globals.h"
|
2012-04-25 00:35:15 +00:00
|
|
|
|
2016-06-30 02:50:06 +00:00
|
|
|
#include "vm/clustered_snapshot.h"
|
2015-09-16 18:18:31 +00:00
|
|
|
#include "vm/compiler_stats.h"
|
2012-04-21 01:36:23 +00:00
|
|
|
#include "vm/dart_api_impl.h"
|
2012-05-01 01:00:04 +00:00
|
|
|
#include "vm/stack_frame.h"
|
2012-04-25 00:35:15 +00:00
|
|
|
#include "vm/unit_test.h"
|
2012-04-21 01:36:23 +00:00
|
|
|
|
2013-04-25 14:22:30 +00:00
|
|
|
using dart::bin::File;
|
|
|
|
|
2012-04-21 01:36:23 +00:00
|
|
|
namespace dart {
|
|
|
|
|
2017-08-11 19:38:22 +00:00
|
|
|
DECLARE_FLAG(bool, use_dart_frontend);
|
|
|
|
|
2012-04-21 01:36:23 +00:00
|
|
|
Benchmark* Benchmark::first_ = NULL;
|
|
|
|
Benchmark* Benchmark::tail_ = NULL;
|
2012-05-01 22:15:26 +00:00
|
|
|
const char* Benchmark::executable_ = NULL;
|
2012-04-21 01:36:23 +00:00
|
|
|
|
2016-02-22 16:53:11 +00:00
|
|
|
//
|
|
|
|
// Measure compile of all dart2js(compiler) functions.
|
|
|
|
//
|
|
|
|
static char* ComputeDart2JSPath(const char* arg) {
|
|
|
|
char buffer[2048];
|
2017-08-30 16:34:34 +00:00
|
|
|
char* dart2js_path = strdup(File::GetCanonicalPath(NULL, arg));
|
2016-11-08 21:54:47 +00:00
|
|
|
const char* compiler_path = "%s%spkg%scompiler%slib%scompiler.dart";
|
2016-02-22 16:53:11 +00:00
|
|
|
const char* path_separator = File::PathSeparator();
|
|
|
|
ASSERT(path_separator != NULL && strlen(path_separator) == 1);
|
|
|
|
char* ptr = strrchr(dart2js_path, *path_separator);
|
|
|
|
while (ptr != NULL) {
|
|
|
|
*ptr = '\0';
|
2016-11-08 21:54:47 +00:00
|
|
|
OS::SNPrint(buffer, 2048, compiler_path, dart2js_path, path_separator,
|
|
|
|
path_separator, path_separator, path_separator, path_separator);
|
2017-08-30 16:34:34 +00:00
|
|
|
if (File::Exists(NULL, buffer)) {
|
2016-02-22 16:53:11 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
ptr = strrchr(dart2js_path, *path_separator);
|
|
|
|
}
|
|
|
|
if (ptr == NULL) {
|
|
|
|
free(dart2js_path);
|
|
|
|
dart2js_path = NULL;
|
|
|
|
}
|
|
|
|
return dart2js_path;
|
|
|
|
}
|
|
|
|
|
2016-11-08 21:54:47 +00:00
|
|
|
static void func(Dart_NativeArguments args) {}
|
2016-02-22 16:53:11 +00:00
|
|
|
|
|
|
|
static Dart_NativeFunction NativeResolver(Dart_Handle name,
|
|
|
|
int arg_count,
|
|
|
|
bool* auto_setup_scope) {
|
|
|
|
ASSERT(auto_setup_scope != NULL);
|
|
|
|
*auto_setup_scope = false;
|
|
|
|
return &func;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void SetupDart2JSPackagePath() {
|
|
|
|
bool worked = bin::DartUtils::SetOriginalWorkingDirectory();
|
|
|
|
EXPECT(worked);
|
|
|
|
|
|
|
|
Dart_Handle result = bin::DartUtils::PrepareForScriptLoading(false, false);
|
|
|
|
DART_CHECK_VALID(result);
|
|
|
|
|
|
|
|
// Setup package root.
|
|
|
|
char buffer[2048];
|
|
|
|
char* executable_path =
|
2017-08-30 16:34:34 +00:00
|
|
|
strdup(File::GetCanonicalPath(NULL, Benchmark::Executable()));
|
2016-02-22 16:53:11 +00:00
|
|
|
const char* packages_path = "%s%s..%spackages";
|
|
|
|
const char* path_separator = File::PathSeparator();
|
2016-11-08 21:54:47 +00:00
|
|
|
OS::SNPrint(buffer, 2048, packages_path, executable_path, path_separator,
|
|
|
|
path_separator);
|
2016-02-22 16:53:11 +00:00
|
|
|
result = bin::DartUtils::SetupPackageRoot(buffer, NULL);
|
|
|
|
DART_CHECK_VALID(result);
|
|
|
|
}
|
|
|
|
|
2012-05-01 22:15:26 +00:00
|
|
|
void Benchmark::RunAll(const char* executable) {
|
|
|
|
SetExecutable(executable);
|
2012-04-21 01:36:23 +00:00
|
|
|
Benchmark* benchmark = first_;
|
|
|
|
while (benchmark != NULL) {
|
|
|
|
benchmark->RunBenchmark();
|
|
|
|
benchmark = benchmark->next_;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-23 18:25:02 +00:00
|
|
|
Dart_Isolate Benchmark::CreateIsolate(const uint8_t* snapshot_data,
|
|
|
|
const uint8_t* snapshot_instructions) {
|
2016-02-04 17:18:31 +00:00
|
|
|
char* err = NULL;
|
2017-08-11 19:38:22 +00:00
|
|
|
Dart_IsolateFlags api_flags;
|
|
|
|
Isolate::FlagsInitialize(&api_flags);
|
|
|
|
api_flags.use_dart_frontend = FLAG_use_dart_frontend;
|
2017-01-23 18:25:02 +00:00
|
|
|
isolate_ = Dart_CreateIsolate(NULL, NULL, snapshot_data,
|
2017-08-11 19:38:22 +00:00
|
|
|
snapshot_instructions, &api_flags, NULL, &err);
|
2016-02-04 17:18:31 +00:00
|
|
|
EXPECT(isolate_ != NULL);
|
|
|
|
free(err);
|
|
|
|
return isolate_;
|
|
|
|
}
|
|
|
|
|
2012-05-01 01:00:04 +00:00
|
|
|
//
|
|
|
|
// Measure compile of all functions in dart core lib classes.
|
|
|
|
//
|
2012-04-21 01:36:23 +00:00
|
|
|
BENCHMARK(CorelibCompileAll) {
|
2013-05-22 16:07:25 +00:00
|
|
|
bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
|
|
|
|
bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
|
2016-02-01 18:57:34 +00:00
|
|
|
TransitionNativeToVM transition(thread);
|
2012-05-01 01:00:04 +00:00
|
|
|
Timer timer(true, "Compile all of Core lib benchmark");
|
2012-04-21 01:36:23 +00:00
|
|
|
timer.Start();
|
2015-10-19 17:27:36 +00:00
|
|
|
const Error& error = Error::Handle(Library::CompileAll());
|
2012-08-28 21:18:21 +00:00
|
|
|
if (!error.IsNull()) {
|
|
|
|
OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s",
|
|
|
|
error.ToErrorCString());
|
|
|
|
}
|
2015-09-16 18:18:31 +00:00
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
2016-02-22 16:53:11 +00:00
|
|
|
#ifndef PRODUCT
|
|
|
|
|
2015-09-16 18:18:31 +00:00
|
|
|
BENCHMARK(CorelibCompilerStats) {
|
|
|
|
bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
|
|
|
|
bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
|
2016-02-01 18:57:34 +00:00
|
|
|
TransitionNativeToVM transition(thread);
|
2016-03-30 20:38:32 +00:00
|
|
|
CompilerStats* stats = thread->isolate()->aggregate_compiler_stats();
|
2015-09-16 18:18:31 +00:00
|
|
|
ASSERT(stats != NULL);
|
|
|
|
stats->EnableBenchmark();
|
|
|
|
Timer timer(true, "Compiler stats compiling all of Core lib");
|
|
|
|
timer.Start();
|
2015-10-19 17:27:36 +00:00
|
|
|
const Error& error = Error::Handle(Library::CompileAll());
|
2015-09-16 18:18:31 +00:00
|
|
|
if (!error.IsNull()) {
|
|
|
|
OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s",
|
|
|
|
error.ToErrorCString());
|
|
|
|
}
|
2012-04-21 01:36:23 +00:00
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
2016-02-22 16:53:11 +00:00
|
|
|
BENCHMARK(Dart2JSCompilerStats) {
|
|
|
|
bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
|
|
|
|
bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
|
|
|
|
SetupDart2JSPackagePath();
|
|
|
|
char* dart_root = ComputeDart2JSPath(Benchmark::Executable());
|
|
|
|
char* script = NULL;
|
|
|
|
if (dart_root != NULL) {
|
|
|
|
HANDLESCOPE(thread);
|
2016-11-08 21:54:47 +00:00
|
|
|
script = OS::SCreate(NULL, "import '%s/pkg/compiler/lib/compiler.dart';",
|
|
|
|
dart_root);
|
2016-02-22 16:53:11 +00:00
|
|
|
Dart_Handle lib = TestCase::LoadTestScript(
|
2016-11-08 21:54:47 +00:00
|
|
|
script, reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
|
2016-02-22 16:53:11 +00:00
|
|
|
EXPECT_VALID(lib);
|
|
|
|
} else {
|
|
|
|
Dart_Handle lib = TestCase::LoadTestScript(
|
|
|
|
"import 'pkg/compiler/lib/compiler.dart';",
|
|
|
|
reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
|
|
|
|
EXPECT_VALID(lib);
|
|
|
|
}
|
2016-03-30 20:38:32 +00:00
|
|
|
CompilerStats* stats = thread->isolate()->aggregate_compiler_stats();
|
2016-02-22 16:53:11 +00:00
|
|
|
ASSERT(stats != NULL);
|
|
|
|
stats->EnableBenchmark();
|
|
|
|
Timer timer(true, "Compile all of dart2js benchmark");
|
|
|
|
timer.Start();
|
2016-02-25 15:53:39 +00:00
|
|
|
#if !defined(PRODUCT)
|
|
|
|
// Constant in product mode.
|
2016-02-22 16:53:11 +00:00
|
|
|
const bool old_flag = FLAG_background_compilation;
|
|
|
|
FLAG_background_compilation = false;
|
2016-02-25 15:53:39 +00:00
|
|
|
#endif
|
2016-02-22 16:53:11 +00:00
|
|
|
Dart_Handle result = Dart_CompileAll();
|
2016-02-25 15:53:39 +00:00
|
|
|
#if !defined(PRODUCT)
|
2016-02-22 16:53:11 +00:00
|
|
|
FLAG_background_compilation = old_flag;
|
2016-02-25 15:53:39 +00:00
|
|
|
#endif
|
2016-02-22 16:53:11 +00:00
|
|
|
EXPECT_VALID(result);
|
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
free(dart_root);
|
|
|
|
free(script);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // !PRODUCT
|
|
|
|
|
2012-05-01 01:00:04 +00:00
|
|
|
//
|
|
|
|
// Measure creation of core isolate from a snapshot.
|
|
|
|
//
|
2012-04-21 01:36:23 +00:00
|
|
|
BENCHMARK(CorelibIsolateStartup) {
|
2014-06-06 01:28:50 +00:00
|
|
|
const int kNumIterations = 1000;
|
|
|
|
Timer timer(true, "CorelibIsolateStartup");
|
2015-11-25 19:07:22 +00:00
|
|
|
Isolate* isolate = thread->isolate();
|
2016-02-01 18:57:34 +00:00
|
|
|
Dart_ExitIsolate();
|
2012-04-21 01:36:23 +00:00
|
|
|
for (int i = 0; i < kNumIterations; i++) {
|
2014-06-06 01:28:50 +00:00
|
|
|
timer.Start();
|
|
|
|
TestCase::CreateTestIsolate();
|
|
|
|
timer.Stop();
|
2012-04-21 01:36:23 +00:00
|
|
|
Dart_ShutdownIsolate();
|
|
|
|
}
|
2014-06-06 01:28:50 +00:00
|
|
|
benchmark->set_score(timer.TotalElapsedTime() / kNumIterations);
|
2016-02-01 18:57:34 +00:00
|
|
|
Dart_EnterIsolate(reinterpret_cast<Dart_Isolate>(isolate));
|
2012-04-25 00:35:15 +00:00
|
|
|
}
|
|
|
|
|
2012-05-01 01:00:04 +00:00
|
|
|
//
|
|
|
|
// Measure invocation of Dart API functions.
|
|
|
|
//
|
|
|
|
static void InitNativeFields(Dart_NativeArguments args) {
|
2012-04-25 00:35:15 +00:00
|
|
|
Dart_EnterScope();
|
|
|
|
int count = Dart_GetNativeArgumentCount(args);
|
|
|
|
EXPECT_EQ(1, count);
|
|
|
|
|
|
|
|
Dart_Handle recv = Dart_GetNativeArgument(args, 0);
|
2012-08-06 07:55:53 +00:00
|
|
|
EXPECT_VALID(recv);
|
2012-04-25 00:35:15 +00:00
|
|
|
Dart_Handle result = Dart_SetNativeInstanceField(recv, 0, 7);
|
2012-08-06 07:55:53 +00:00
|
|
|
EXPECT_VALID(result);
|
2012-04-25 00:35:15 +00:00
|
|
|
|
|
|
|
Dart_ExitScope();
|
|
|
|
}
|
|
|
|
|
|
|
|
// The specific api functions called here are a bit arbitrary. We are
|
|
|
|
// trying to get a sense of the overhead for using the dart api.
|
2012-05-01 01:00:04 +00:00
|
|
|
static void UseDartApi(Dart_NativeArguments args) {
|
2012-04-25 00:35:15 +00:00
|
|
|
int count = Dart_GetNativeArgumentCount(args);
|
|
|
|
EXPECT_EQ(3, count);
|
|
|
|
|
2013-08-02 22:47:26 +00:00
|
|
|
// Get native field from receiver.
|
|
|
|
intptr_t receiver_value;
|
|
|
|
Dart_Handle result = Dart_GetNativeReceiver(args, &receiver_value);
|
|
|
|
EXPECT_VALID(result);
|
|
|
|
EXPECT_EQ(7, receiver_value);
|
2012-04-25 00:35:15 +00:00
|
|
|
|
|
|
|
// Get param1.
|
|
|
|
Dart_Handle param1 = Dart_GetNativeArgument(args, 1);
|
2012-08-06 07:55:53 +00:00
|
|
|
EXPECT_VALID(param1);
|
2012-04-25 00:35:15 +00:00
|
|
|
EXPECT(Dart_IsInteger(param1));
|
|
|
|
bool fits = false;
|
2013-08-02 22:47:26 +00:00
|
|
|
result = Dart_IntegerFitsIntoInt64(param1, &fits);
|
2012-08-06 07:55:53 +00:00
|
|
|
EXPECT_VALID(result);
|
|
|
|
EXPECT(fits);
|
2012-04-25 00:35:15 +00:00
|
|
|
int64_t value1;
|
|
|
|
result = Dart_IntegerToInt64(param1, &value1);
|
2012-08-06 07:55:53 +00:00
|
|
|
EXPECT_VALID(result);
|
2012-04-25 00:35:15 +00:00
|
|
|
EXPECT_LE(0, value1);
|
|
|
|
EXPECT_LE(value1, 1000000);
|
|
|
|
|
|
|
|
// Return param + receiver.field.
|
2013-08-02 22:47:26 +00:00
|
|
|
Dart_SetReturnValue(args, Dart_NewInteger(value1 * receiver_value));
|
2012-04-25 00:35:15 +00:00
|
|
|
}
|
|
|
|
|
2013-12-19 17:47:56 +00:00
|
|
|
static Dart_NativeFunction bm_uda_lookup(Dart_Handle name,
|
|
|
|
int argument_count,
|
|
|
|
bool* auto_setup_scope) {
|
|
|
|
ASSERT(auto_setup_scope != NULL);
|
2016-02-01 18:57:34 +00:00
|
|
|
*auto_setup_scope = true;
|
2012-04-25 00:35:15 +00:00
|
|
|
const char* cstr = NULL;
|
|
|
|
Dart_Handle result = Dart_StringToCString(name, &cstr);
|
2012-08-06 07:55:53 +00:00
|
|
|
EXPECT_VALID(result);
|
2012-04-25 00:35:15 +00:00
|
|
|
if (strcmp(cstr, "init") == 0) {
|
|
|
|
return InitNativeFields;
|
|
|
|
} else {
|
|
|
|
return UseDartApi;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BENCHMARK(UseDartApi) {
|
2012-06-28 21:04:58 +00:00
|
|
|
const int kNumIterations = 1000000;
|
2012-04-25 00:35:15 +00:00
|
|
|
const char* kScriptChars =
|
|
|
|
"class Class extends NativeFieldsWrapper{\n"
|
|
|
|
" int init() native 'init';\n"
|
|
|
|
" int method(int param1, int param2) native 'method';\n"
|
|
|
|
"}\n"
|
|
|
|
"\n"
|
|
|
|
"void benchmark(int count) {\n"
|
|
|
|
" Class c = new Class();\n"
|
|
|
|
" c.init();\n"
|
|
|
|
" for (int i = 0; i < count; i++) {\n"
|
|
|
|
" c.method(i,7);\n"
|
|
|
|
" }\n"
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
Dart_Handle lib = TestCase::LoadTestScript(
|
2016-11-08 21:54:47 +00:00
|
|
|
kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(bm_uda_lookup),
|
|
|
|
USER_TEST_URI, false);
|
2012-04-25 00:35:15 +00:00
|
|
|
|
|
|
|
// Create a native wrapper class with native fields.
|
2016-11-08 21:54:47 +00:00
|
|
|
Dart_Handle result =
|
|
|
|
Dart_CreateNativeWrapperClass(lib, NewString("NativeFieldsWrapper"), 1);
|
2012-08-06 07:55:53 +00:00
|
|
|
EXPECT_VALID(result);
|
2014-07-22 20:08:15 +00:00
|
|
|
result = Dart_FinalizeLoading(false);
|
|
|
|
EXPECT_VALID(result);
|
2012-04-25 00:35:15 +00:00
|
|
|
|
|
|
|
Dart_Handle args[1];
|
|
|
|
args[0] = Dart_NewInteger(kNumIterations);
|
2012-07-11 00:11:58 +00:00
|
|
|
|
|
|
|
// Warmup first to avoid compilation jitters.
|
2012-10-31 17:56:46 +00:00
|
|
|
Dart_Invoke(lib, NewString("benchmark"), 1, args);
|
2012-07-11 00:11:58 +00:00
|
|
|
|
|
|
|
Timer timer(true, "UseDartApi benchmark");
|
|
|
|
timer.Start();
|
2012-10-31 17:56:46 +00:00
|
|
|
Dart_Invoke(lib, NewString("benchmark"), 1, args);
|
2012-04-25 00:35:15 +00:00
|
|
|
timer.Stop();
|
2012-04-21 01:36:23 +00:00
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
2012-04-25 00:35:15 +00:00
|
|
|
benchmark->set_score(elapsed_time);
|
2012-04-21 01:36:23 +00:00
|
|
|
}
|
|
|
|
|
2012-08-29 18:06:17 +00:00
|
|
|
//
|
|
|
|
// Measure time accessing internal and external strings.
|
|
|
|
//
|
|
|
|
BENCHMARK(DartStringAccess) {
|
|
|
|
const int kNumIterations = 10000000;
|
|
|
|
Timer timer(true, "DartStringAccess benchmark");
|
|
|
|
timer.Start();
|
|
|
|
Dart_EnterScope();
|
|
|
|
|
|
|
|
// Create strings.
|
2016-11-08 21:54:47 +00:00
|
|
|
uint8_t data8[] = {'o', 'n', 'e', 0xFF};
|
2012-08-29 18:06:17 +00:00
|
|
|
int external_peer_data = 123;
|
2013-08-22 17:10:37 +00:00
|
|
|
intptr_t char_size;
|
|
|
|
intptr_t str_len;
|
2012-11-29 23:43:47 +00:00
|
|
|
Dart_Handle external_string = Dart_NewExternalLatin1String(
|
|
|
|
data8, ARRAY_SIZE(data8), &external_peer_data, NULL);
|
2012-10-31 17:56:46 +00:00
|
|
|
Dart_Handle internal_string = NewString("two");
|
2012-08-29 18:06:17 +00:00
|
|
|
|
|
|
|
// Run benchmark.
|
|
|
|
for (int64_t i = 0; i < kNumIterations; i++) {
|
|
|
|
EXPECT(Dart_IsString(internal_string));
|
|
|
|
EXPECT(!Dart_IsExternalString(internal_string));
|
|
|
|
EXPECT_VALID(external_string);
|
|
|
|
EXPECT(Dart_IsExternalString(external_string));
|
|
|
|
void* external_peer = NULL;
|
2016-11-08 21:54:47 +00:00
|
|
|
EXPECT_VALID(Dart_StringGetProperties(external_string, &char_size, &str_len,
|
2013-08-22 17:10:37 +00:00
|
|
|
&external_peer));
|
|
|
|
EXPECT_EQ(1, char_size);
|
|
|
|
EXPECT_EQ(4, str_len);
|
2012-08-29 18:06:17 +00:00
|
|
|
EXPECT_EQ(&external_peer_data, external_peer);
|
|
|
|
}
|
|
|
|
|
|
|
|
Dart_ExitScope();
|
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
2012-05-01 01:00:04 +00:00
|
|
|
BENCHMARK(Dart2JSCompileAll) {
|
2013-05-22 16:07:25 +00:00
|
|
|
bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
|
|
|
|
bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
|
2014-11-05 08:51:01 +00:00
|
|
|
SetupDart2JSPackagePath();
|
2012-05-01 22:15:26 +00:00
|
|
|
char* dart_root = ComputeDart2JSPath(Benchmark::Executable());
|
2012-08-31 16:55:03 +00:00
|
|
|
char* script = NULL;
|
2012-05-01 22:15:26 +00:00
|
|
|
if (dart_root != NULL) {
|
2015-09-02 00:18:55 +00:00
|
|
|
HANDLESCOPE(thread);
|
2016-11-08 21:54:47 +00:00
|
|
|
script = OS::SCreate(NULL, "import '%s/pkg/compiler/lib/compiler.dart';",
|
|
|
|
dart_root);
|
2012-08-31 16:55:03 +00:00
|
|
|
Dart_Handle lib = TestCase::LoadTestScript(
|
2016-11-08 21:54:47 +00:00
|
|
|
script, reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
|
2012-08-31 16:55:03 +00:00
|
|
|
EXPECT_VALID(lib);
|
2012-05-01 22:15:26 +00:00
|
|
|
} else {
|
2012-08-31 16:55:03 +00:00
|
|
|
Dart_Handle lib = TestCase::LoadTestScript(
|
2014-11-05 08:51:01 +00:00
|
|
|
"import 'pkg/compiler/lib/compiler.dart';",
|
2012-08-31 16:55:03 +00:00
|
|
|
reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
|
|
|
|
EXPECT_VALID(lib);
|
2012-05-01 22:15:26 +00:00
|
|
|
}
|
2012-05-01 01:00:04 +00:00
|
|
|
Timer timer(true, "Compile all of dart2js benchmark");
|
|
|
|
timer.Start();
|
2016-02-25 15:53:39 +00:00
|
|
|
#if !defined(PRODUCT)
|
2016-02-12 23:40:07 +00:00
|
|
|
const bool old_flag = FLAG_background_compilation;
|
|
|
|
FLAG_background_compilation = false;
|
2016-02-25 15:53:39 +00:00
|
|
|
#endif
|
2012-05-01 01:00:04 +00:00
|
|
|
Dart_Handle result = Dart_CompileAll();
|
2016-02-25 15:53:39 +00:00
|
|
|
#if !defined(PRODUCT)
|
2016-02-12 23:40:07 +00:00
|
|
|
FLAG_background_compilation = old_flag;
|
2016-02-25 15:53:39 +00:00
|
|
|
#endif
|
2012-08-06 07:55:53 +00:00
|
|
|
EXPECT_VALID(result);
|
2012-05-01 01:00:04 +00:00
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
2012-05-01 22:15:26 +00:00
|
|
|
free(dart_root);
|
2012-08-31 16:55:03 +00:00
|
|
|
free(script);
|
2012-05-01 01:00:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Measure frame lookup during stack traversal.
|
|
|
|
//
|
|
|
|
static void StackFrame_accessFrame(Dart_NativeArguments args) {
|
|
|
|
const int kNumIterations = 100;
|
|
|
|
Code& code = Code::Handle();
|
|
|
|
Timer timer(true, "LookupDartCode benchmark");
|
|
|
|
timer.Start();
|
|
|
|
for (int i = 0; i < kNumIterations; i++) {
|
2017-05-03 08:26:55 +00:00
|
|
|
StackFrameIterator frames(StackFrameIterator::kDontValidateFrames,
|
|
|
|
Thread::Current(),
|
|
|
|
StackFrameIterator::kNoCrossThreadIteration);
|
2012-05-01 01:00:04 +00:00
|
|
|
StackFrame* frame = frames.NextFrame();
|
|
|
|
while (frame != NULL) {
|
|
|
|
if (frame->IsStubFrame()) {
|
2012-07-02 21:42:53 +00:00
|
|
|
code = frame->LookupDartCode();
|
2012-05-01 01:00:04 +00:00
|
|
|
EXPECT(code.function() == Function::null());
|
|
|
|
} else if (frame->IsDartFrame()) {
|
2012-07-02 21:42:53 +00:00
|
|
|
code = frame->LookupDartCode();
|
2012-05-01 01:00:04 +00:00
|
|
|
EXPECT(code.function() != Function::null());
|
|
|
|
}
|
|
|
|
frame = frames.NextFrame();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
Dart_SetReturnValue(args, Dart_NewInteger(elapsed_time));
|
|
|
|
}
|
|
|
|
|
|
|
|
static Dart_NativeFunction StackFrameNativeResolver(Dart_Handle name,
|
2013-12-19 17:47:56 +00:00
|
|
|
int arg_count,
|
|
|
|
bool* auto_setup_scope) {
|
|
|
|
ASSERT(auto_setup_scope != NULL);
|
|
|
|
*auto_setup_scope = false;
|
2012-05-01 01:00:04 +00:00
|
|
|
return &StackFrame_accessFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unit test case to verify stack frame iteration.
|
|
|
|
BENCHMARK(FrameLookup) {
|
|
|
|
const char* kScriptChars =
|
|
|
|
"class StackFrame {"
|
|
|
|
" static int accessFrame() native \"StackFrame_accessFrame\";"
|
|
|
|
"} "
|
|
|
|
"class First {"
|
|
|
|
" First() { }"
|
|
|
|
" int method1(int param) {"
|
|
|
|
" if (param == 1) {"
|
|
|
|
" param = method2(200);"
|
|
|
|
" } else {"
|
|
|
|
" param = method2(100);"
|
|
|
|
" }"
|
|
|
|
" return param;"
|
|
|
|
" }"
|
|
|
|
" int method2(int param) {"
|
|
|
|
" if (param == 200) {"
|
|
|
|
" return First.staticmethod(this, param);"
|
|
|
|
" } else {"
|
|
|
|
" return First.staticmethod(this, 10);"
|
|
|
|
" }"
|
|
|
|
" }"
|
|
|
|
" static int staticmethod(First obj, int param) {"
|
|
|
|
" if (param == 10) {"
|
|
|
|
" return obj.method3(10);"
|
|
|
|
" } else {"
|
|
|
|
" return obj.method3(200);"
|
|
|
|
" }"
|
|
|
|
" }"
|
|
|
|
" int method3(int param) {"
|
|
|
|
" return StackFrame.accessFrame();"
|
|
|
|
" }"
|
|
|
|
"}"
|
|
|
|
"class StackFrameTest {"
|
|
|
|
" static int testMain() {"
|
|
|
|
" First obj = new First();"
|
|
|
|
" return obj.method1(1);"
|
|
|
|
" }"
|
|
|
|
"}";
|
|
|
|
Dart_Handle lib = TestCase::LoadTestScript(
|
|
|
|
kScriptChars,
|
|
|
|
reinterpret_cast<Dart_NativeEntryResolver>(StackFrameNativeResolver));
|
2012-10-31 17:56:46 +00:00
|
|
|
Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrameTest"));
|
|
|
|
Dart_Handle result = Dart_Invoke(cls, NewString("testMain"), 0, NULL);
|
2012-05-01 01:00:04 +00:00
|
|
|
EXPECT_VALID(result);
|
|
|
|
int64_t elapsed_time = 0;
|
2012-08-06 07:55:53 +00:00
|
|
|
result = Dart_IntegerToInt64(result, &elapsed_time);
|
|
|
|
EXPECT_VALID(result);
|
2012-05-01 01:00:04 +00:00
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
2016-11-08 21:54:47 +00:00
|
|
|
static uint8_t* malloc_allocator(uint8_t* ptr,
|
|
|
|
intptr_t old_size,
|
|
|
|
intptr_t new_size) {
|
2013-06-05 17:28:01 +00:00
|
|
|
return reinterpret_cast<uint8_t*>(realloc(ptr, new_size));
|
2013-02-12 02:39:00 +00:00
|
|
|
}
|
|
|
|
|
2017-01-12 00:50:04 +00:00
|
|
|
static void malloc_deallocator(uint8_t* ptr) {
|
|
|
|
free(ptr);
|
|
|
|
}
|
|
|
|
|
2014-06-10 05:20:52 +00:00
|
|
|
BENCHMARK_SIZE(CoreSnapshotSize) {
|
2013-02-12 02:39:00 +00:00
|
|
|
const char* kScriptChars =
|
|
|
|
"import 'dart:async';\n"
|
|
|
|
"import 'dart:core';\n"
|
|
|
|
"import 'dart:collection';\n"
|
2014-01-16 12:06:38 +00:00
|
|
|
"import 'dart:_internal';\n"
|
2013-02-12 02:39:00 +00:00
|
|
|
"import 'dart:math';\n"
|
|
|
|
"import 'dart:isolate';\n"
|
|
|
|
"import 'dart:mirrors';\n"
|
2013-04-23 11:54:54 +00:00
|
|
|
"import 'dart:typed_data';\n"
|
2013-02-12 02:39:00 +00:00
|
|
|
"\n";
|
|
|
|
|
|
|
|
// Start an Isolate, load a script and create a full snapshot.
|
2017-01-23 18:25:02 +00:00
|
|
|
uint8_t* vm_snapshot_data_buffer;
|
|
|
|
uint8_t* isolate_snapshot_data_buffer;
|
2014-05-09 18:25:41 +00:00
|
|
|
// Need to load the script into the dart: core library due to
|
|
|
|
// the import of dart:_internal.
|
|
|
|
TestCase::LoadCoreTestScript(kScriptChars, NULL);
|
2015-11-25 19:07:22 +00:00
|
|
|
Api::CheckAndFinalizePendingClasses(thread);
|
2013-02-12 02:39:00 +00:00
|
|
|
|
2017-08-08 00:51:21 +00:00
|
|
|
TransitionNativeToVM transition(thread);
|
2013-02-12 02:39:00 +00:00
|
|
|
// Write snapshot with object content.
|
2017-05-31 20:49:09 +00:00
|
|
|
FullSnapshotWriter writer(Snapshot::kFull, &vm_snapshot_data_buffer,
|
2017-01-23 18:25:02 +00:00
|
|
|
&isolate_snapshot_data_buffer, &malloc_allocator,
|
2017-01-26 17:53:06 +00:00
|
|
|
NULL, NULL /* image_writer */);
|
2013-02-12 02:39:00 +00:00
|
|
|
writer.WriteFullSnapshot();
|
2017-01-23 18:25:02 +00:00
|
|
|
const Snapshot* snapshot =
|
|
|
|
Snapshot::SetupFromBuffer(isolate_snapshot_data_buffer);
|
2017-05-31 20:49:09 +00:00
|
|
|
ASSERT(snapshot->kind() == Snapshot::kFull);
|
2013-02-12 02:39:00 +00:00
|
|
|
benchmark->set_score(snapshot->length());
|
2017-01-11 19:12:40 +00:00
|
|
|
|
2017-01-23 18:25:02 +00:00
|
|
|
free(vm_snapshot_data_buffer);
|
|
|
|
free(isolate_snapshot_data_buffer);
|
2013-02-12 02:39:00 +00:00
|
|
|
}
|
|
|
|
|
2014-06-10 05:20:52 +00:00
|
|
|
BENCHMARK_SIZE(StandaloneSnapshotSize) {
|
2013-02-12 02:39:00 +00:00
|
|
|
const char* kScriptChars =
|
|
|
|
"import 'dart:async';\n"
|
|
|
|
"import 'dart:core';\n"
|
|
|
|
"import 'dart:collection';\n"
|
2014-01-16 12:06:38 +00:00
|
|
|
"import 'dart:_internal';\n"
|
2013-10-25 10:30:34 +00:00
|
|
|
"import 'dart:convert';\n"
|
2013-02-12 02:39:00 +00:00
|
|
|
"import 'dart:math';\n"
|
|
|
|
"import 'dart:isolate';\n"
|
|
|
|
"import 'dart:mirrors';\n"
|
2013-04-23 11:54:54 +00:00
|
|
|
"import 'dart:typed_data';\n"
|
2014-06-13 22:43:31 +00:00
|
|
|
"import 'dart:_builtin';\n"
|
2013-02-12 02:39:00 +00:00
|
|
|
"import 'dart:io';\n"
|
|
|
|
"\n";
|
|
|
|
|
|
|
|
// Start an Isolate, load a script and create a full snapshot.
|
2017-01-23 18:25:02 +00:00
|
|
|
uint8_t* vm_snapshot_data_buffer;
|
|
|
|
uint8_t* isolate_snapshot_data_buffer;
|
2014-05-09 18:25:41 +00:00
|
|
|
// Need to load the script into the dart: core library due to
|
|
|
|
// the import of dart:_internal.
|
|
|
|
TestCase::LoadCoreTestScript(kScriptChars, NULL);
|
2015-11-25 19:07:22 +00:00
|
|
|
Api::CheckAndFinalizePendingClasses(thread);
|
2013-02-12 02:39:00 +00:00
|
|
|
|
2017-08-08 00:51:21 +00:00
|
|
|
TransitionNativeToVM transition(thread);
|
2013-02-12 02:39:00 +00:00
|
|
|
// Write snapshot with object content.
|
2017-05-31 20:49:09 +00:00
|
|
|
FullSnapshotWriter writer(Snapshot::kFull, &vm_snapshot_data_buffer,
|
2017-01-23 18:25:02 +00:00
|
|
|
&isolate_snapshot_data_buffer, &malloc_allocator,
|
2017-01-26 17:53:06 +00:00
|
|
|
NULL, NULL /* image_writer */);
|
2013-02-12 02:39:00 +00:00
|
|
|
writer.WriteFullSnapshot();
|
2017-01-23 18:25:02 +00:00
|
|
|
const Snapshot* snapshot =
|
|
|
|
Snapshot::SetupFromBuffer(isolate_snapshot_data_buffer);
|
2017-05-31 20:49:09 +00:00
|
|
|
ASSERT(snapshot->kind() == Snapshot::kFull);
|
2013-02-12 02:39:00 +00:00
|
|
|
benchmark->set_score(snapshot->length());
|
2017-01-11 19:12:40 +00:00
|
|
|
|
2017-01-23 18:25:02 +00:00
|
|
|
free(vm_snapshot_data_buffer);
|
|
|
|
free(isolate_snapshot_data_buffer);
|
2013-02-12 02:39:00 +00:00
|
|
|
}
|
|
|
|
|
2013-07-24 22:06:04 +00:00
|
|
|
BENCHMARK(CreateMirrorSystem) {
|
|
|
|
const char* kScriptChars =
|
|
|
|
"import 'dart:mirrors';\n"
|
|
|
|
"\n"
|
|
|
|
"void benchmark() {\n"
|
|
|
|
" currentMirrorSystem();\n"
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
|
|
|
|
|
|
|
|
Timer timer(true, "currentMirrorSystem() benchmark");
|
|
|
|
timer.Start();
|
2013-07-25 09:37:38 +00:00
|
|
|
Dart_Invoke(lib, NewString("benchmark"), 0, NULL);
|
2013-07-24 22:06:04 +00:00
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
2014-02-07 17:43:21 +00:00
|
|
|
BENCHMARK(EnterExitIsolate) {
|
|
|
|
const char* kScriptChars =
|
|
|
|
"import 'dart:core';\n"
|
|
|
|
"\n";
|
|
|
|
const intptr_t kLoopCount = 1000000;
|
|
|
|
TestCase::LoadTestScript(kScriptChars, NULL);
|
2015-11-25 19:07:22 +00:00
|
|
|
Api::CheckAndFinalizePendingClasses(thread);
|
2014-02-07 17:43:21 +00:00
|
|
|
Dart_Isolate isolate = Dart_CurrentIsolate();
|
|
|
|
Timer timer(true, "Enter and Exit isolate");
|
|
|
|
timer.Start();
|
|
|
|
for (intptr_t i = 0; i < kLoopCount; i++) {
|
|
|
|
Dart_ExitIsolate();
|
|
|
|
Dart_EnterIsolate(isolate);
|
|
|
|
}
|
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
2014-03-19 08:54:06 +00:00
|
|
|
static uint8_t message_buffer[64];
|
2016-11-08 21:54:47 +00:00
|
|
|
static uint8_t* message_allocator(uint8_t* ptr,
|
|
|
|
intptr_t old_size,
|
|
|
|
intptr_t new_size) {
|
2014-03-19 08:54:06 +00:00
|
|
|
return message_buffer;
|
|
|
|
}
|
2017-01-12 00:50:04 +00:00
|
|
|
static void message_deallocator(uint8_t* ptr) {}
|
2014-03-19 08:54:06 +00:00
|
|
|
|
|
|
|
BENCHMARK(SerializeNull) {
|
2017-10-31 15:46:43 +00:00
|
|
|
TransitionNativeToVM transition(thread);
|
2014-03-19 08:54:06 +00:00
|
|
|
const Object& null_object = Object::Handle();
|
|
|
|
const intptr_t kLoopCount = 1000000;
|
|
|
|
uint8_t* buffer;
|
|
|
|
Timer timer(true, "Serialize Null");
|
|
|
|
timer.Start();
|
|
|
|
for (intptr_t i = 0; i < kLoopCount; i++) {
|
2015-09-02 23:07:48 +00:00
|
|
|
StackZone zone(thread);
|
2017-01-12 00:50:04 +00:00
|
|
|
MessageWriter writer(&buffer, &message_allocator, &message_deallocator,
|
|
|
|
true);
|
2014-03-19 08:54:06 +00:00
|
|
|
writer.WriteMessage(null_object);
|
|
|
|
intptr_t buffer_len = writer.BytesWritten();
|
|
|
|
|
|
|
|
// Read object back from the snapshot.
|
2016-11-08 21:54:47 +00:00
|
|
|
MessageSnapshotReader reader(buffer, buffer_len, thread);
|
2014-03-19 08:54:06 +00:00
|
|
|
reader.ReadObject();
|
|
|
|
}
|
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
|
|
|
BENCHMARK(SerializeSmi) {
|
2017-10-31 15:46:43 +00:00
|
|
|
TransitionNativeToVM transition(thread);
|
2014-03-19 08:54:06 +00:00
|
|
|
const Integer& smi_object = Integer::Handle(Smi::New(42));
|
|
|
|
const intptr_t kLoopCount = 1000000;
|
|
|
|
uint8_t* buffer;
|
|
|
|
Timer timer(true, "Serialize Smi");
|
|
|
|
timer.Start();
|
|
|
|
for (intptr_t i = 0; i < kLoopCount; i++) {
|
2015-09-02 23:07:48 +00:00
|
|
|
StackZone zone(thread);
|
2017-01-12 00:50:04 +00:00
|
|
|
MessageWriter writer(&buffer, &message_allocator, &message_deallocator,
|
|
|
|
true);
|
2014-03-19 08:54:06 +00:00
|
|
|
writer.WriteMessage(smi_object);
|
|
|
|
intptr_t buffer_len = writer.BytesWritten();
|
|
|
|
|
|
|
|
// Read object back from the snapshot.
|
2016-11-08 21:54:47 +00:00
|
|
|
MessageSnapshotReader reader(buffer, buffer_len, thread);
|
2014-03-19 08:54:06 +00:00
|
|
|
reader.ReadObject();
|
|
|
|
}
|
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
|
|
|
BENCHMARK(SimpleMessage) {
|
2016-02-01 18:57:34 +00:00
|
|
|
TransitionNativeToVM transition(thread);
|
2014-03-19 08:54:06 +00:00
|
|
|
const Array& array_object = Array::Handle(Array::New(2));
|
|
|
|
array_object.SetAt(0, Integer::Handle(Smi::New(42)));
|
|
|
|
array_object.SetAt(1, Object::Handle());
|
|
|
|
const intptr_t kLoopCount = 1000000;
|
|
|
|
uint8_t* buffer;
|
|
|
|
Timer timer(true, "Simple Message");
|
|
|
|
timer.Start();
|
|
|
|
for (intptr_t i = 0; i < kLoopCount; i++) {
|
2015-09-02 23:07:48 +00:00
|
|
|
StackZone zone(thread);
|
2017-01-12 00:50:04 +00:00
|
|
|
MessageWriter writer(&buffer, &malloc_allocator, &malloc_deallocator, true);
|
2014-03-19 08:54:06 +00:00
|
|
|
writer.WriteMessage(array_object);
|
|
|
|
intptr_t buffer_len = writer.BytesWritten();
|
|
|
|
|
|
|
|
// Read object back from the snapshot.
|
2016-11-08 21:54:47 +00:00
|
|
|
MessageSnapshotReader reader(buffer, buffer_len, thread);
|
2014-03-19 08:54:06 +00:00
|
|
|
reader.ReadObject();
|
|
|
|
free(buffer);
|
|
|
|
}
|
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
2015-05-28 16:32:54 +00:00
|
|
|
BENCHMARK(LargeMap) {
|
|
|
|
const char* kScript =
|
|
|
|
"makeMap() {\n"
|
|
|
|
" Map m = {};\n"
|
|
|
|
" for (int i = 0; i < 100000; ++i) m[i*13+i*(i>>7)] = i;\n"
|
|
|
|
" return m;\n"
|
|
|
|
"}";
|
|
|
|
Dart_Handle h_lib = TestCase::LoadTestScript(kScript, NULL);
|
|
|
|
EXPECT_VALID(h_lib);
|
|
|
|
Dart_Handle h_result = Dart_Invoke(h_lib, NewString("makeMap"), 0, NULL);
|
|
|
|
EXPECT_VALID(h_result);
|
|
|
|
Instance& map = Instance::Handle();
|
|
|
|
map ^= Api::UnwrapHandle(h_result);
|
|
|
|
const intptr_t kLoopCount = 100;
|
|
|
|
uint8_t* buffer;
|
|
|
|
Timer timer(true, "Large Map");
|
|
|
|
timer.Start();
|
|
|
|
for (intptr_t i = 0; i < kLoopCount; i++) {
|
2015-09-02 23:07:48 +00:00
|
|
|
StackZone zone(thread);
|
2017-01-12 00:50:04 +00:00
|
|
|
MessageWriter writer(&buffer, &malloc_allocator, &malloc_deallocator, true);
|
2015-05-28 16:32:54 +00:00
|
|
|
writer.WriteMessage(map);
|
|
|
|
intptr_t buffer_len = writer.BytesWritten();
|
|
|
|
|
|
|
|
// Read object back from the snapshot.
|
2016-11-08 21:54:47 +00:00
|
|
|
MessageSnapshotReader reader(buffer, buffer_len, thread);
|
2015-05-28 16:32:54 +00:00
|
|
|
reader.ReadObject();
|
|
|
|
free(buffer);
|
|
|
|
}
|
|
|
|
timer.Stop();
|
|
|
|
int64_t elapsed_time = timer.TotalElapsedTime();
|
|
|
|
benchmark->set_score(elapsed_time);
|
|
|
|
}
|
|
|
|
|
2016-09-09 16:47:56 +00:00
|
|
|
BENCHMARK_MEMORY(InitialRSS) {
|
2017-08-15 00:02:22 +00:00
|
|
|
benchmark->set_score(bin::Process::MaxRSS());
|
2016-09-09 16:47:56 +00:00
|
|
|
}
|
|
|
|
|
2012-04-21 01:36:23 +00:00
|
|
|
} // namespace dart
|