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

Unified Diff: pkg/kernel/test/treeshaker_bench.dart

Issue 2627723003: Improvements to the kernel tree shaker. (Closed)
Patch Set: Fix issue with async method whose body becomes tree shaken, but not its interface Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698