Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: runtime/vm/benchmark_test.cc

Issue 128653004: Use list of isolates in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | runtime/vm/isolate.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/benchmark_test.h" 5 #include "vm/benchmark_test.h"
6 6
7 #include "bin/builtin.h" 7 #include "bin/builtin.h"
8 #include "bin/file.h" 8 #include "bin/file.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); 475 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
476 476
477 Timer timer(true, "currentMirrorSystem() benchmark"); 477 Timer timer(true, "currentMirrorSystem() benchmark");
478 timer.Start(); 478 timer.Start();
479 Dart_Invoke(lib, NewString("benchmark"), 0, NULL); 479 Dart_Invoke(lib, NewString("benchmark"), 0, NULL);
480 timer.Stop(); 480 timer.Stop();
481 int64_t elapsed_time = timer.TotalElapsedTime(); 481 int64_t elapsed_time = timer.TotalElapsedTime();
482 benchmark->set_score(elapsed_time); 482 benchmark->set_score(elapsed_time);
483 } 483 }
484 484
485
486 BENCHMARK(EnterExitIsolate) {
487 const char* kScriptChars =
488 "import 'dart:core';\n"
489 "\n";
490 const intptr_t kLoopCount = 1000000;
491 TestCase::LoadTestScript(kScriptChars, NULL);
492 Api::CheckIsolateState(Isolate::Current());
493 Dart_Isolate isolate = Dart_CurrentIsolate();
494 Timer timer(true, "Enter and Exit isolate");
495 timer.Start();
496 for (intptr_t i = 0; i < kLoopCount; i++) {
497 Dart_ExitIsolate();
498 Dart_EnterIsolate(isolate);
499 }
500 timer.Stop();
501 int64_t elapsed_time = timer.TotalElapsedTime();
502 benchmark->set_score(elapsed_time);
503 }
siva 2014/02/05 19:09:15 I think we also need a benchmark to measure Creati
Cutch 2014/02/05 23:00:31 With a linked list approach the only bottleneck wi
504
485 } // namespace dart 505 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | runtime/vm/isolate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698