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

Unified Diff: pkg/analysis_server/benchmark/integration/main.dart

Issue 1249793007: performance measurement mods: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 5 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/analysis_server/benchmark/integration/main.dart
diff --git a/pkg/analysis_server/benchmark/integration/main.dart b/pkg/analysis_server/benchmark/integration/main.dart
index 793110de50c1a6e99db76ef0cbcc248aed2f1ab5..979f25659714968e660d86db176e230a481c0573 100644
--- a/pkg/analysis_server/benchmark/integration/main.dart
+++ b/pkg/analysis_server/benchmark/integration/main.dart
@@ -26,7 +26,8 @@ main(List<String> rawArgs) {
});
PerfArgs args = parseArgs(rawArgs);
- Driver driver = new Driver(logger);
+ Driver driver = new Driver(
+ diagnosticPort: args.diagnosticPort, newTaskModel: args.newTaskModel);
Stream<Operation> stream = openInput(args);
StreamSubscription<Operation> subscription;
subscription = stream.listen((Operation op) {
@@ -56,6 +57,7 @@ const DIAGNOSTIC_PORT_OPTION = 'diagnosticPort';
const HELP_CMDLINE_OPTION = 'help';
const INPUT_CMDLINE_OPTION = 'input';
const MAP_OPTION = 'map';
+const NEW_TASK_MODEL_OPTION = 'newTaskModel';
/**
* The amount of time to give the server to respond to a shutdown request
@@ -79,16 +81,15 @@ Stream<Operation> openInput(PerfArgs args) {
} else {
inputRaw = new File(args.inputPath).openRead();
}
- args.srcPathMap.forEach((oldPath, newPath) {
- logger.log(
- Level.INFO, 'mapping source path\n from $oldPath\n to $newPath');
- });
+ for (PathMapEntry entry in args.srcPathMap.entries) {
+ logger.log(Level.INFO, 'mapping source path\n'
+ ' from ${entry.oldSrcPrefix}\n to ${entry.newSrcPrefix}');
+ }
logger.log(Level.INFO, 'tmpSrcDir: ${args.tmpSrcDirPath}');
return inputRaw
.transform(SYSTEM_ENCODING.decoder)
.transform(new LineSplitter())
- .transform(new InputConverter(args.tmpSrcDirPath, args.srcPathMap,
- diagnosticPort: args.diagnosticPort));
+ .transform(new InputConverter(args.tmpSrcDirPath, args.srcPathMap));
}
/**
@@ -113,6 +114,10 @@ PerfArgs parseArgs(List<String> rawArgs) {
parser.addOption(TMP_SRC_DIR_OPTION, abbr: 't', help: '<dirPath>\n'
'The temporary directory containing source used during performance measurement.\n'
'WARNING: The contents of the target directory will be modified');
+ parser.addFlag(NEW_TASK_MODEL_OPTION,
+ help: "enable the use of the new task model",
+ defaultsTo: false,
+ negatable: false);
parser.addOption(DIAGNOSTIC_PORT_OPTION,
abbr: 'd',
help: 'localhost port on which server will provide diagnostic web pages');
@@ -143,15 +148,14 @@ PerfArgs parseArgs(List<String> rawArgs) {
showHelp = true;
}
- perfArgs.srcPathMap = <String, String>{};
for (String pair in args[MAP_OPTION]) {
if (pair is String) {
int index = pair.indexOf(',');
if (index != -1 && pair.indexOf(',', index + 1) == -1) {
- String oldSrcPath = _withTrailingSeparator(pair.substring(0, index));
- String newSrcPath = _withTrailingSeparator(pair.substring(index + 1));
- if (new Directory(newSrcPath).existsSync()) {
- perfArgs.srcPathMap[oldSrcPath] = newSrcPath;
+ String oldSrcPrefix = _withTrailingSeparator(pair.substring(0, index));
+ String newSrcPrefix = _withTrailingSeparator(pair.substring(index + 1));
+ if (new Directory(newSrcPrefix).existsSync()) {
+ perfArgs.srcPathMap.add(oldSrcPrefix, newSrcPrefix);
continue;
}
}
@@ -166,6 +170,8 @@ PerfArgs parseArgs(List<String> rawArgs) {
showHelp = true;
}
+ perfArgs.newTaskModel = args[NEW_TASK_MODEL_OPTION];
+
String portText = args[DIAGNOSTIC_PORT_OPTION];
if (portText != null) {
perfArgs.diagnosticPort = int.parse(portText, onError: (s) {
@@ -226,7 +232,7 @@ class PerfArgs {
* when the instrumentation or log file was generated
* to the target source directory used during performance testing.
*/
- Map<String, String> srcPathMap;
+ final PathMap srcPathMap = new PathMap();
/**
* The temporary directory containing source used during performance measurement.
@@ -237,4 +243,9 @@ class PerfArgs {
* The diagnostic port for Analysis Server or `null` if none.
*/
int diagnosticPort;
+
+ /**
+ * `true` if the server should run using the new task model.
+ */
+ bool newTaskModel;
}

Powered by Google App Engine
This is Rietveld 408576698