diff --git a/dev/benchmarks/microbenchmarks/lib/common.dart b/dev/benchmarks/microbenchmarks/lib/common.dart index cb695f1b29..f34e403e57 100644 --- a/dev/benchmarks/microbenchmarks/lib/common.dart +++ b/dev/benchmarks/microbenchmarks/lib/common.dart @@ -39,9 +39,13 @@ class BenchmarkResultPrinter { /// for computer consumption and once formatted as plain text for humans. void printToStdout() { // IMPORTANT: keep these values in sync with dev/devicelab/bin/tasks/microbenchmarks.dart - print('================ RESULTS ================'); - print(_printJson()); - print('================ FORMATTED =============='); + const String jsonStart = '================ RESULTS ================'; + const String jsonEnd = '================ FORMATTED =============='; + const String jsonPrefix = ':::JSON:::'; + + print(jsonStart); + print('$jsonPrefix ${_printJson()}'); + print(jsonEnd); print(_printPlainText()); } diff --git a/dev/devicelab/lib/tasks/microbenchmarks.dart b/dev/devicelab/lib/tasks/microbenchmarks.dart index a7ba367374..e774ac95f7 100644 --- a/dev/devicelab/lib/tasks/microbenchmarks.dart +++ b/dev/devicelab/lib/tasks/microbenchmarks.dart @@ -33,8 +33,9 @@ TaskFunction createMicrobenchmarkTask() { await prepareProvisioningCertificates(appDir.path); return await _startFlutter( options: [ - '--profile', + '-v', // --release doesn't work on iOS due to code signing issues + '--profile', '-d', device.deviceId, benchmarkPath, @@ -72,6 +73,7 @@ Future> _readJsonResults(Process process) { // IMPORTANT: keep these values in sync with dev/benchmarks/microbenchmarks/lib/common.dart const String jsonStart = '================ RESULTS ================'; const String jsonEnd = '================ FORMATTED =============='; + const String jsonPrefix = ':::JSON:::'; bool jsonStarted = false; final StringBuffer jsonBuf = new StringBuffer(); final Completer> completer = new Completer>(); @@ -83,7 +85,6 @@ Future> _readJsonResults(Process process) { stderr.writeln('[STDERR] $line'); }); - int prefixLength = 0; bool processWasKilledIntentionally = false; final StreamSubscription stdoutSub = process.stdout .transform(const Utf8Decoder()) @@ -93,7 +94,6 @@ Future> _readJsonResults(Process process) { if (line.contains(jsonStart)) { jsonStarted = true; - prefixLength = line.indexOf(jsonStart); return; } @@ -106,7 +106,7 @@ Future> _readJsonResults(Process process) { } if (jsonStarted) - jsonBuf.writeln(line.substring(prefixLength)); + jsonBuf.writeln(line.substring(line.indexOf(jsonPrefix) + jsonPrefix.length)); }); process.exitCode.then((int code) {