OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 import 'package:kernel/kernel.dart'; | 5 import 'package:kernel/kernel.dart'; |
6 import 'package:kernel/class_hierarchy.dart'; | 6 import 'package:kernel/class_hierarchy.dart'; |
7 import 'package:args/args.dart'; | 7 import 'package:args/args.dart'; |
8 import 'class_hierarchy_basic.dart'; | 8 import 'class_hierarchy_basic.dart'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
11 ArgParser argParser = new ArgParser() | 11 ArgParser argParser = new ArgParser() |
12 ..addFlag('basic', help: 'Measure the basic implementation', negatable: false) | 12 ..addFlag('basic', help: 'Measure the basic implementation', negatable: false) |
13 ..addOption('count', abbr: 'c', | 13 ..addOption('count', |
| 14 abbr: 'c', |
14 help: 'Build N copies of the class hierarchy', | 15 help: 'Build N copies of the class hierarchy', |
15 defaultsTo: '300'); | 16 defaultsTo: '300'); |
16 | 17 |
17 String usage = """ | 18 String usage = """ |
18 Usage: class_hierarchy_membench [options] FILE.dart | 19 Usage: class_hierarchy_membench [options] FILE.dart |
19 | 20 |
20 Options: | 21 Options: |
21 ${argParser.usage} | 22 ${argParser.usage} |
22 """; | 23 """; |
23 | 24 |
(...skipping 30 matching lines...) Expand all Loading... |
54 | 55 |
55 if (args.contains('-v')) { | 56 if (args.contains('-v')) { |
56 // Use of the list for something to avoid premature GC. | 57 // Use of the list for something to avoid premature GC. |
57 int size = 0; | 58 int size = 0; |
58 for (var classHierarchy in keepAlive) { | 59 for (var classHierarchy in keepAlive) { |
59 size += classHierarchy.getSuperTypeHashTableSize(); | 60 size += classHierarchy.getSuperTypeHashTableSize(); |
60 } | 61 } |
61 print(size); | 62 print(size); |
62 } | 63 } |
63 } | 64 } |
OLD | NEW |