Unverified Commit 9d007877 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Add build-after-edit benchmark (#107192)

* Add build-after-edit benchmark

* Clean up analyzer warnings

* Restore line break
parent 1c433997
...@@ -1335,6 +1335,21 @@ class CompileTest { ...@@ -1335,6 +1335,21 @@ class CompileTest {
...compileSecondDebug, ...compileSecondDebug,
}; };
final File mainDart = File('$testDirectory/lib/main.dart');
if (mainDart.existsSync()) {
final List<int> bytes = mainDart.readAsBytesSync();
// "Touch" the file
mainDart.writeAsStringSync(' ', mode: FileMode.append, flush: true);
// Build after "edit" without clean should be faster than first build
final Map<String, dynamic> compileAfterEditDebug = await _compileDebug(
clean: false,
metricKey: 'debug_compile_after_edit_millis',
);
metrics.addAll(compileAfterEditDebug);
// Revert the changes
mainDart.writeAsBytesSync(bytes, flush: true);
}
return TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList()); return TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList());
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment