Add build-after-edit benchmark (#107192)
* Add build-after-edit benchmark * Clean up analyzer warnings * Restore line break
This commit is contained in:
parent
1c4339974d
commit
9d00787791
@ -1335,6 +1335,21 @@ class CompileTest {
|
||||
...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());
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user