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

Side by Side Diff: pkg/kernel/test/treeshaker_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/test/class_hierarchy_bench.dart ('k') | pkg/kernel/test/treeshaker_membench.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 library kernel.treeshaker_bench; 4 library kernel.treeshaker_bench;
5 5
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:args/args.dart'; 8 import 'package:args/args.dart';
9 import 'package:kernel/class_hierarchy.dart'; 9 import 'package:kernel/class_hierarchy.dart';
10 import 'package:kernel/core_types.dart'; 10 import 'package:kernel/core_types.dart';
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 exit(1); 43 exit(1);
44 } 44 }
45 String filename = options.rest.single; 45 String filename = options.rest.single;
46 bool strongMode = options['strong']; 46 bool strongMode = options['strong'];
47 47
48 Program program = loadProgramFromBinary(filename); 48 Program program = loadProgramFromBinary(filename);
49 49
50 ClassHierarchy buildClassHierarchy() { 50 ClassHierarchy buildClassHierarchy() {
51 return options['basic'] 51 return options['basic']
52 ? new BasicClassHierarchy(program) 52 ? new BasicClassHierarchy(program)
53 : new ClassHierarchy(program); 53 : new ClosedWorldClassHierarchy(program);
54 } 54 }
55 55
56 CoreTypes coreTypes = new CoreTypes(program); 56 CoreTypes coreTypes = new CoreTypes(program);
57 57
58 var watch = new Stopwatch()..start(); 58 var watch = new Stopwatch()..start();
59 ClassHierarchy sharedClassHierarchy = buildClassHierarchy(); 59 ClassHierarchy sharedClassHierarchy = buildClassHierarchy();
60 int coldHierarchyTime = watch.elapsedMicroseconds; 60 int coldHierarchyTime = watch.elapsedMicroseconds;
61 var shaker = new TreeShaker(coreTypes, sharedClassHierarchy, program, 61 var shaker = new TreeShaker(coreTypes, sharedClassHierarchy, program,
62 strongMode: strongMode); 62 strongMode: strongMode);
63 if (options['diagnose']) { 63 if (options['diagnose']) {
(...skipping 24 matching lines...) Expand all
88 88
89 var coldShakingMs = coldTreeShakingTime ~/ 1000; 89 var coldShakingMs = coldTreeShakingTime ~/ 1000;
90 var coldHierarchyMs = coldHierarchyTime ~/ 1000; 90 var coldHierarchyMs = coldHierarchyTime ~/ 1000;
91 var hotShakingMs = hotTreeShakingTime ~/ 1000; 91 var hotShakingMs = hotTreeShakingTime ~/ 1000;
92 var hotHierarchyMs = hotHierarchyTime ~/ 1000; 92 var hotHierarchyMs = hotHierarchyTime ~/ 1000;
93 93
94 print(''' 94 print('''
95 build.cold $coldShakingMs ms ($coldHierarchyMs ms from hierarchy) 95 build.cold $coldShakingMs ms ($coldHierarchyMs ms from hierarchy)
96 build.hot $hotShakingMs ms ($hotHierarchyMs ms from hierarchy)'''); 96 build.hot $hotShakingMs ms ($hotHierarchyMs ms from hierarchy)''');
97 } 97 }
OLDNEW
« no previous file with comments | « pkg/kernel/test/class_hierarchy_bench.dart ('k') | pkg/kernel/test/treeshaker_membench.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698