Reduce noise on the memory benchmarks (#19630)

- Check memory usage in release builds, not profile.
- Use multiple runs and average the results.
This commit is contained in:
Ian Hickson
2018-08-02 12:22:15 -07:00
committed by GitHub
parent 1f7082dbd8
commit 8eb5cb7dc0
21 changed files with 564 additions and 220 deletions

View File

@@ -44,7 +44,7 @@ Future<Null> main() async {
fail('Unrecognized demo names in _kSkippedDemoTitles: $_kSkippedDemoTitles');
runApp(const GalleryApp(testMode: true));
final _LiveWidgetController controller = new _LiveWidgetController();
final _LiveWidgetController controller = new _LiveWidgetController(WidgetsBinding.instance);
for (GalleryDemoCategory category in kAllGalleryDemoCategories) {
await controller.tap(find.text(category.name));
for (GalleryDemo demo in kGalleryCategoryToDemos[category]) {
@@ -73,9 +73,8 @@ Future<Null> main() async {
}
}
class _LiveWidgetController {
final WidgetController _controller = new WidgetController(WidgetsBinding.instance);
class _LiveWidgetController extends LiveWidgetController {
_LiveWidgetController(WidgetsBinding binding) : super(binding);
/// With [frameSync] enabled, Flutter Driver will wait to perform an action
/// until there are no pending frames in the app under test.
@@ -107,8 +106,9 @@ class _LiveWidgetController {
return finder;
}
Future<Null> tap(Finder finder) async {
await _controller.tap(await _waitForElement(finder));
@override
Future<Null> tap(Finder finder, { int pointer }) async {
await tap(await _waitForElement(finder), pointer: pointer);
}
Future<Null> scrollIntoView(Finder finder, {double alignment}) async {