| 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:math'; | 9 import 'dart:math'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 print('Exactly one file must be given'); | 34 print('Exactly one file must be given'); |
| 35 exit(1); | 35 exit(1); |
| 36 } | 36 } |
| 37 String filename = options.rest.single; | 37 String filename = options.rest.single; |
| 38 | 38 |
| 39 Program program = loadProgramFromBinary(filename); | 39 Program program = loadProgramFromBinary(filename); |
| 40 | 40 |
| 41 ClassHierarchy buildHierarchy() { | 41 ClassHierarchy buildHierarchy() { |
| 42 return options['basic'] | 42 return options['basic'] |
| 43 ? new BasicClassHierarchy(program) | 43 ? new BasicClassHierarchy(program) |
| 44 : new ClassHierarchy(program); | 44 : new ClosedWorldClassHierarchy(program); |
| 45 } | 45 } |
| 46 | 46 |
| 47 var watch = new Stopwatch()..start(); | 47 var watch = new Stopwatch()..start(); |
| 48 buildHierarchy(); | 48 buildHierarchy(); |
| 49 int coldBuildTime = watch.elapsedMilliseconds; | 49 int coldBuildTime = watch.elapsedMilliseconds; |
| 50 watch.reset(); | 50 watch.reset(); |
| 51 const int numBuildTrials = 100; | 51 const int numBuildTrials = 100; |
| 52 for (int i = 0; i < numBuildTrials; i++) { | 52 for (int i = 0; i < numBuildTrials; i++) { |
| 53 buildHierarchy(); | 53 buildHierarchy(); |
| 54 } | 54 } |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 : list[mid].toDouble(); | 336 : list[mid].toDouble(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 num sum(Iterable<num> values) { | 339 num sum(Iterable<num> values) { |
| 340 num result = 0; | 340 num result = 0; |
| 341 for (var x in values) { | 341 for (var x in values) { |
| 342 result += x; | 342 result += x; |
| 343 } | 343 } |
| 344 return result; | 344 return result; |
| 345 } | 345 } |
| OLD | NEW |