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

Side by Side Diff: pkg/kernel/test/verify_bench.dart

Issue 2531873002: Add --verify-ir flag to dartk and test.py. (Closed)
Patch Set: Minor fixes Created 4 years 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
« no previous file with comments | « pkg/kernel/test/parent_pointer_test_disabled.dart ('k') | pkg/kernel/test/verify_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'dart:io'; 5 import 'dart:io';
6 import 'package:kernel/checks.dart'; 6
7 import 'package:kernel/kernel.dart'; 7 import 'package:kernel/kernel.dart';
8 import 'package:kernel/verifier.dart';
8 9
9 final String usage = ''' 10 final String usage = '''
10 Usage: check_bench FILE.dill 11 Usage: verify_bench FILE.dill
11 12
12 Measures the time it takes to run sanity checks on the given program. 13 Measures the time it takes to run kernel verifier on the given program.
13 '''; 14 ''';
14 15
15 main(List<String> args) { 16 main(List<String> args) {
16 if (args.length != 1) { 17 if (args.length != 1) {
17 print(usage); 18 print(usage);
18 exit(1); 19 exit(1);
19 } 20 }
20 var program = loadProgramFromBinary(args[0]); 21 var program = loadProgramFromBinary(args[0]);
21 var watch = new Stopwatch()..start(); 22 var watch = new Stopwatch()..start();
22 runSanityChecks(program); 23 verifyProgram(program);
23 print('Cold: ${watch.elapsedMilliseconds} ms'); 24 print('Cold: ${watch.elapsedMilliseconds} ms');
24 const int warmUpTrials = 20; 25 const int warmUpTrials = 20;
25 for (int i = 0; i < warmUpTrials; ++i) { 26 for (int i = 0; i < warmUpTrials; ++i) {
26 runSanityChecks(program); 27 verifyProgram(program);
27 } 28 }
28 watch.reset(); 29 watch.reset();
29 const int numberOfTrials = 100; 30 const int numberOfTrials = 100;
30 for (int i = 0; i < numberOfTrials; ++i) { 31 for (int i = 0; i < numberOfTrials; ++i) {
31 runSanityChecks(program); 32 verifyProgram(program);
32 } 33 }
33 double millisecondsPerRun = watch.elapsedMilliseconds / numberOfTrials; 34 double millisecondsPerRun = watch.elapsedMilliseconds / numberOfTrials;
34 print('Hot: $millisecondsPerRun ms'); 35 print('Hot: $millisecondsPerRun ms');
35 } 36 }
OLDNEW
« no previous file with comments | « pkg/kernel/test/parent_pointer_test_disabled.dart ('k') | pkg/kernel/test/verify_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698