Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
5969eb60
Unverified
Commit
5969eb60
authored
Jul 08, 2020
by
Dan Field
Committed by
GitHub
Jul 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark memory usage for grid view of memory intensive widgets (#61025)
parent
07e2d6f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
0 deletions
+119
-0
common.dart
dev/benchmarks/macrobenchmarks/lib/common.dart
+1
-0
main.dart
dev/benchmarks/macrobenchmarks/lib/main.dart
+9
-0
heavy_grid_view.dart
dev/benchmarks/macrobenchmarks/lib/src/heavy_grid_view.dart
+32
-0
heavy_gridview.dart
...enchmarks/macrobenchmarks/test_memory/heavy_gridview.dart
+24
-0
fast_scroll_heavy_gridview__memory.dart
...vicelab/bin/tasks/fast_scroll_heavy_gridview__memory.dart
+45
-0
manifest.yaml
dev/devicelab/manifest.yaml
+8
-0
No files found.
dev/benchmarks/macrobenchmarks/lib/common.dart
View file @
5969eb60
...
...
@@ -15,5 +15,6 @@ const String kColorFilterAndFadeRouteName = '/color_filter_and_fade';
const
String
kFadingChildAnimationRouteName
=
'/fading_child_animation'
;
const
String
kImageFilteredTransformAnimationRouteName
=
'/imagefiltered_transform_animation'
;
const
String
kMultiWidgetConstructionRouteName
=
'/multi_widget_construction'
;
const
String
kHeavyGridViewRouteName
=
'/heavy_gridview'
;
const
String
kScrollableName
=
'/macrobenchmark_listview'
;
dev/benchmarks/macrobenchmarks/lib/main.dart
View file @
5969eb60
...
...
@@ -4,6 +4,7 @@
import
'package:flutter/material.dart'
;
import
'package:macrobenchmarks/src/color_filter_and_fade.dart'
;
import
'package:macrobenchmarks/src/heavy_grid_view.dart'
;
import
'package:macrobenchmarks/src/large_images.dart'
;
import
'package:macrobenchmarks/src/picture_cache.dart'
;
...
...
@@ -45,6 +46,7 @@ class MacrobenchmarksApp extends StatelessWidget {
kFadingChildAnimationRouteName:
(
BuildContext
context
)
=>
const
FilteredChildAnimationPage
(
FilterType
.
opacity
),
kImageFilteredTransformAnimationRouteName:
(
BuildContext
context
)
=>
const
FilteredChildAnimationPage
(
FilterType
.
rotateFilter
),
kMultiWidgetConstructionRouteName:
(
BuildContext
context
)
=>
const
MultiWidgetConstructTable
(
10
,
20
),
kHeavyGridViewRouteName:
(
BuildContext
context
)
=>
HeavyGridViewPage
(),
},
);
}
...
...
@@ -151,6 +153,13 @@ class HomePage extends StatelessWidget {
Navigator
.
pushNamed
(
context
,
kMultiWidgetConstructionRouteName
);
},
),
RaisedButton
(
key:
const
Key
(
kHeavyGridViewRouteName
),
child:
const
Text
(
'Heavy Grid View'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
kHeavyGridViewRouteName
);
},
),
],
),
);
...
...
dev/benchmarks/macrobenchmarks/lib/src/heavy_grid_view.dart
0 → 100644
View file @
5969eb60
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
class
HeavyGridViewPage
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
GridView
.
builder
(
itemCount:
1000
,
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
3
),
itemBuilder:
(
BuildContext
context
,
int
index
)
=>
HeavyWidget
(
index
),
).
build
(
context
);
}
}
class
HeavyWidget
extends
StatelessWidget
{
HeavyWidget
(
this
.
index
)
:
super
(
key:
ValueKey
<
int
>(
index
));
final
int
index
;
final
List
<
int
>
_weight
=
List
<
int
>(
1000000
);
@override
Widget
build
(
BuildContext
context
)
{
return
SizedBox
(
width:
200
,
height:
200
,
child:
Text
(
'
$index
:
${_weight.length}
'
),
);
}
}
dev/benchmarks/macrobenchmarks/test_memory/heavy_gridview.dart
0 → 100644
View file @
5969eb60
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:macrobenchmarks/common.dart'
;
import
'package:macrobenchmarks/main.dart'
;
Future
<
void
>
endOfAnimation
()
async
{
do
{
await
SchedulerBinding
.
instance
.
endOfFrame
;
}
while
(
SchedulerBinding
.
instance
.
hasScheduledFrame
);
}
Future
<
void
>
main
()
async
{
runApp
(
const
MacrobenchmarksApp
(
initialRoute:
kHeavyGridViewRouteName
));
await
endOfAnimation
();
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
50
));
debugPrint
(
'==== MEMORY BENCHMARK ==== READY ===='
);
}
dev/devicelab/bin/tasks/fast_scroll_heavy_gridview__memory.dart
0 → 100644
View file @
5969eb60
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
const
String
kPackageName
=
'com.example.macrobenchmarks'
;
const
String
kActivityName
=
'com.example.macrobenchmarks.MainActivity'
;
class
FastScrollHeavyGridViewMemoryTest
extends
MemoryTest
{
FastScrollHeavyGridViewMemoryTest
()
:
super
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test_memory/heavy_gridview.dart'
,
kPackageName
,
);
@override
AndroidDevice
get
device
=>
super
.
device
as
AndroidDevice
;
@override
int
get
iterationCount
=>
5
;
@override
Future
<
void
>
useMemory
()
async
{
await
launchApp
();
await
recordStart
();
await
device
.
shellExec
(
'input'
,
<
String
>[
'swipe'
,
'50 1500 50 50 50'
]);
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
1500
));
await
device
.
shellExec
(
'input'
,
<
String
>[
'swipe'
,
'50 1500 50 50 50'
]);
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
1500
));
await
device
.
shellExec
(
'input'
,
<
String
>[
'swipe'
,
'50 1500 50 50 50'
]);
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
1500
));
await
recordEnd
();
}
}
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
FastScrollHeavyGridViewMemoryTest
().
run
);
}
dev/devicelab/manifest.yaml
View file @
5969eb60
...
...
@@ -803,6 +803,14 @@ tasks:
stage
:
devicelab
required_agent_capabilities
:
[
"
mac/android"
]
fast_scroll_heavy_gridview__memory
:
description
:
>
Measures memory usage for scrolling through a grid view of heavy memory
usage widgets.
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
flaky
:
true
animated_placeholder_perf
:
description
:
>
Measures frame build and rasterizer times, as well as frame build counts
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment