| Index: pkg/kernel/test/treeshaker_bench.dart
|
| diff --git a/pkg/kernel/test/treeshaker_bench.dart b/pkg/kernel/test/treeshaker_bench.dart
|
| index 3096f993671d928dbdf7d49f80f11df15647d333..7a83c7a4aa2c4cc215284d0acd1a3cab83ef45f3 100644
|
| --- a/pkg/kernel/test/treeshaker_bench.dart
|
| +++ b/pkg/kernel/test/treeshaker_bench.dart
|
| @@ -13,16 +13,18 @@ import 'package:kernel/transformations/treeshaker.dart';
|
|
|
| import 'class_hierarchy_basic.dart';
|
|
|
| -ArgParser argParser = new ArgParser()
|
| +ArgParser argParser = new ArgParser(allowTrailingOptions: true)
|
| ..addFlag('basic',
|
| help: 'Use the basic class hierarchy implementation', negatable: false)
|
| ..addFlag('from-scratch',
|
| help: 'Rebuild class hierarchy for each tree shaking', negatable: false)
|
| ..addFlag('diagnose',
|
| - abbr: 'd', help: 'Print internal diagnostics', negatable: false);
|
| + abbr: 'd', help: 'Print internal diagnostics', negatable: false)
|
| + ..addFlag('strong',
|
| + help: 'Run the tree shaker in strong mode', negatable: false);
|
|
|
| String usage = '''
|
| -Usage: treeshaker_bench [options] FILE.dart
|
| +Usage: treeshaker_bench [options] FILE.dill
|
|
|
| Benchmark the tree shaker and the class hierarchy it depends on.
|
|
|
| @@ -41,6 +43,7 @@ void main(List<String> args) {
|
| exit(1);
|
| }
|
| String filename = options.rest.single;
|
| + bool strongMode = options['strong'];
|
|
|
| Program program = loadProgramFromBinary(filename);
|
|
|
| @@ -56,7 +59,9 @@ void main(List<String> args) {
|
| ClassHierarchy sharedClassHierarchy = buildClassHierarchy();
|
| int coldHierarchyTime = watch.elapsedMicroseconds;
|
| var shaker = new TreeShaker(program,
|
| - hierarchy: sharedClassHierarchy, coreTypes: coreTypes);
|
| + hierarchy: sharedClassHierarchy,
|
| + coreTypes: coreTypes,
|
| + strongMode: strongMode);
|
| if (options['diagnose']) {
|
| print(shaker.getDiagnosticString());
|
| }
|
| @@ -77,7 +82,8 @@ void main(List<String> args) {
|
| watch.reset();
|
| var hierarchy = getClassHierarchy();
|
| hotHierarchyTime += watch.elapsedMicroseconds;
|
| - new TreeShaker(program, hierarchy: hierarchy, coreTypes: coreTypes);
|
| + new TreeShaker(program,
|
| + hierarchy: hierarchy, coreTypes: coreTypes, strongMode: strongMode);
|
| hotTreeShakingTime += watch.elapsedMicroseconds;
|
| }
|
| hotHierarchyTime ~/= numberOfTrials;
|
|
|