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

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

Issue 2930973002: Remove ClassHierarchy factory constructor. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « pkg/kernel/lib/class_hierarchy.dart ('k') | pkg/kernel/test/treeshaker_bench.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 #!/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
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
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 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/class_hierarchy.dart ('k') | pkg/kernel/test/treeshaker_bench.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698