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
9c934041
Unverified
Commit
9c934041
authored
Jan 27, 2022
by
Jim Graham
Committed by
GitHub
Jan 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add benchmarks to measure impact of alpha saveLayers in DisplayLists (#97336)
parent
0c9d24f5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
234 additions
and
0 deletions
+234
-0
.ci.yaml
.ci.yaml
+22
-0
TESTOWNERS
TESTOWNERS
+2
-0
common.dart
dev/benchmarks/macrobenchmarks/lib/common.dart
+3
-0
opacity_peephole.dart
dev/benchmarks/macrobenchmarks/lib/src/opacity_peephole.dart
+127
-0
opacity_peephole_col_of_alpha_savelayer_rows_perf_e2e.dart
...pacity_peephole_col_of_alpha_savelayer_rows_perf_e2e.dart
+19
-0
opacity_peephole_grid_of_alpha_savelayers_perf_e2e.dart
...t/opacity_peephole_grid_of_alpha_savelayers_perf_e2e.dart
+19
-0
opacity_peephole_col_of_alpha_savelayer_rows_perf__e2e_summary.dart
...ephole_col_of_alpha_savelayer_rows_perf__e2e_summary.dart
+14
-0
opacity_peephole_grid_of_alpha_savelayers_perf__e2e_summary.dart
..._peephole_grid_of_alpha_savelayers_perf__e2e_summary.dart
+14
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+14
-0
No files found.
.ci.yaml
View file @
9c934041
...
...
@@ -2282,6 +2282,28 @@ targets:
task_name
:
opacity_peephole_fade_transition_text_perf__e2e_summary
scheduler
:
luci
-
name
:
Linux_android opacity_peephole_grid_of_alpha_savelayers_perf__e2e_summary
bringup
:
true
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
properties
:
tags
:
>
["devicelab","android","linux"]
task_name
:
opacity_peephole_grid_of_alpha_savelayers_perf__e2e_summary
scheduler
:
luci
-
name
:
Linux_android opacity_peephole_col_of_alpha_savelayer_rows_perf__e2e_summary
bringup
:
true
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
properties
:
tags
:
>
["devicelab","android","linux"]
task_name
:
opacity_peephole_col_of_alpha_savelayer_rows_perf__e2e_summary
scheduler
:
luci
-
name
:
Mac build_aar_module_test
recipe
:
devicelab/devicelab_drone
timeout
:
60
...
...
TESTOWNERS
View file @
9c934041
...
...
@@ -66,6 +66,8 @@
/dev/devicelab/bin/tasks/opacity_peephole_one_rect_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_opacity_of_grid_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_fade_transition_text_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_col_of_alpha_savelayer_rows_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_grid_of_alpha_savelayers_perf__e2e_summary.dart @flar @flutter/engine
## Windows Android DeviceLab tests
/dev/devicelab/bin/tasks/basic_material_app_win__compile.dart @zanderso @flutter/tool
...
...
dev/benchmarks/macrobenchmarks/lib/common.dart
View file @
9c934041
...
...
@@ -32,6 +32,9 @@ const String kOpacityPeepholeGridOfOpacityRouteName = '$kOpacityPeepholeRouteNam
const
String
kOpacityPeepholeOpacityOfGridRouteName
=
'
$kOpacityPeepholeRouteName
/opacity_of_grid'
;
const
String
kOpacityPeepholeOpacityOfColOfRowsRouteName
=
'
$kOpacityPeepholeRouteName
/opacity_of_col_of_rows'
;
const
String
kOpacityPeepholeFadeTransitionTextRouteName
=
'
$kOpacityPeepholeRouteName
/fade_transition_text'
;
const
String
kOpacityPeepholeGridOfRectsWithAlphaRouteName
=
'
$kOpacityPeepholeRouteName
/grid_of_rects_with_alpha'
;
const
String
kOpacityPeepholeGridOfAlphaSaveLayerRectsRouteName
=
'
$kOpacityPeepholeRouteName
/grid_of_alpha_savelayer_rects'
;
const
String
kOpacityPeepholeColumnOfAlphaSaveLayerRowsOfRectsRouteName
=
'
$kOpacityPeepholeRouteName
/column_of_alpha_save_layer_rows_of_rects'
;
const
String
kScrollableName
=
'/macrobenchmark_listview'
;
const
String
kOpacityScrollableName
=
'
$kOpacityPeepholeRouteName
/listview'
;
...
...
dev/benchmarks/macrobenchmarks/lib/src/opacity_peephole.dart
View file @
9c934041
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:math'
;
import
'package:flutter/material.dart'
;
import
'../common.dart'
;
...
...
@@ -284,8 +286,133 @@ List<OpacityPeepholeCase> allOpacityPeepholeCases = <OpacityPeepholeCase>[
);
},
),
OpacityPeepholeCase
.
forValue
(
route:
kOpacityPeepholeGridOfRectsWithAlphaRouteName
,
name:
'Grid of Rectangles with alpha'
,
builder:
(
double
v
)
{
return
Opacity
(
opacity:
_opacity
(
v
),
child:
SizedBox
.
expand
(
child:
CustomPaint
(
painter:
RectGridPainter
((
Canvas
canvas
,
Size
size
)
{
const
int
numRows
=
10
;
const
int
numCols
=
7
;
const
double
rectWidth
=
30
;
const
double
rectHeight
=
30
;
final
double
hGap
=
(
size
.
width
-
numCols
*
rectWidth
)
/
(
numCols
+
1
);
final
double
vGap
=
(
size
.
height
-
numRows
*
rectHeight
)
/
(
numRows
+
1
);
final
double
gap
=
min
(
hGap
,
vGap
);
final
double
xOffset
=
(
size
.
width
-
(
numCols
*
(
rectWidth
+
gap
)
-
gap
))
*
0.5
;
final
double
yOffset
=
(
size
.
height
-
(
numRows
*
(
rectHeight
+
gap
)
-
gap
))
*
0.5
;
final
Paint
rectPaint
=
Paint
();
for
(
int
r
=
0
;
r
<
numRows
;
r
++,
v
=
1
-
v
)
{
final
double
y
=
yOffset
+
r
*
(
rectHeight
+
gap
);
double
cv
=
v
;
for
(
int
c
=
0
;
c
<
numCols
;
c
++,
cv
=
1
-
cv
)
{
final
double
x
=
xOffset
+
c
*
(
rectWidth
+
gap
);
rectPaint
.
color
=
Color
.
fromRGBO
(
_red
(
cv
),
_green
(
cv
),
_blue
(
cv
),
_opacity
(
cv
));
final
Rect
rect
=
Rect
.
fromLTWH
(
x
,
y
,
rectWidth
,
rectHeight
);
canvas
.
drawRect
(
rect
,
rectPaint
);
}
}
}),
),
),
);
},
),
OpacityPeepholeCase
.
forValue
(
route:
kOpacityPeepholeGridOfAlphaSaveLayerRectsRouteName
,
name:
'Grid of alpha SaveLayers of Rectangles'
,
builder:
(
double
v
)
{
return
Opacity
(
opacity:
_opacity
(
v
),
child:
SizedBox
.
expand
(
child:
CustomPaint
(
painter:
RectGridPainter
((
Canvas
canvas
,
Size
size
)
{
const
int
numRows
=
10
;
const
int
numCols
=
7
;
const
double
rectWidth
=
30
;
const
double
rectHeight
=
30
;
final
double
hGap
=
(
size
.
width
-
numCols
*
rectWidth
)
/
(
numCols
+
1
);
final
double
vGap
=
(
size
.
height
-
numRows
*
rectHeight
)
/
(
numRows
+
1
);
final
double
gap
=
min
(
hGap
,
vGap
);
final
double
xOffset
=
(
size
.
width
-
(
numCols
*
(
rectWidth
+
gap
)
-
gap
))
*
0.5
;
final
double
yOffset
=
(
size
.
height
-
(
numRows
*
(
rectHeight
+
gap
)
-
gap
))
*
0.5
;
final
Paint
rectPaint
=
Paint
();
final
Paint
layerPaint
=
Paint
();
for
(
int
r
=
0
;
r
<
numRows
;
r
++,
v
=
1
-
v
)
{
final
double
y
=
yOffset
+
r
*
(
rectHeight
+
gap
);
double
cv
=
v
;
for
(
int
c
=
0
;
c
<
numCols
;
c
++,
cv
=
1
-
cv
)
{
final
double
x
=
xOffset
+
c
*
(
rectWidth
+
gap
);
rectPaint
.
color
=
Color
.
fromRGBO
(
_red
(
cv
),
_green
(
cv
),
_blue
(
cv
),
1.0
);
layerPaint
.
color
=
Color
.
fromRGBO
(
255
,
255
,
255
,
_opacity
(
cv
));
final
Rect
rect
=
Rect
.
fromLTWH
(
x
,
y
,
rectWidth
,
rectHeight
);
canvas
.
saveLayer
(
null
,
layerPaint
);
canvas
.
drawRect
(
rect
,
rectPaint
);
canvas
.
restore
();
}
}
}),
),
),
);
},
),
OpacityPeepholeCase
.
forValue
(
route:
kOpacityPeepholeColumnOfAlphaSaveLayerRowsOfRectsRouteName
,
name:
'Grid with alpha SaveLayer on Rows'
,
builder:
(
double
v
)
{
return
Opacity
(
opacity:
_opacity
(
v
),
child:
SizedBox
.
expand
(
child:
CustomPaint
(
painter:
RectGridPainter
((
Canvas
canvas
,
Size
size
)
{
const
int
numRows
=
10
;
const
int
numCols
=
7
;
const
double
rectWidth
=
30
;
const
double
rectHeight
=
30
;
final
double
hGap
=
(
size
.
width
-
numCols
*
rectWidth
)
/
(
numCols
+
1
);
final
double
vGap
=
(
size
.
height
-
numRows
*
rectHeight
)
/
(
numRows
+
1
);
final
double
gap
=
min
(
hGap
,
vGap
);
final
double
xOffset
=
(
size
.
width
-
(
numCols
*
(
rectWidth
+
gap
)
-
gap
))
*
0.5
;
final
double
yOffset
=
(
size
.
height
-
(
numRows
*
(
rectHeight
+
gap
)
-
gap
))
*
0.5
;
final
Paint
rectPaint
=
Paint
();
final
Paint
layerPaint
=
Paint
();
for
(
int
r
=
0
;
r
<
numRows
;
r
++,
v
=
1
-
v
)
{
final
double
y
=
yOffset
+
r
*
(
rectHeight
+
gap
);
layerPaint
.
color
=
Color
.
fromRGBO
(
255
,
255
,
255
,
_opacity
(
v
));
canvas
.
saveLayer
(
null
,
layerPaint
);
double
cv
=
v
;
for
(
int
c
=
0
;
c
<
numCols
;
c
++,
cv
=
1
-
cv
)
{
final
double
x
=
xOffset
+
c
*
(
rectWidth
+
gap
);
rectPaint
.
color
=
Color
.
fromRGBO
(
_red
(
cv
),
_green
(
cv
),
_blue
(
cv
),
1.0
);
final
Rect
rect
=
Rect
.
fromLTWH
(
x
,
y
,
rectWidth
,
rectHeight
);
canvas
.
drawRect
(
rect
,
rectPaint
);
}
canvas
.
restore
();
}
}),
),
),
);
},
),
];
class
RectGridPainter
extends
CustomPainter
{
RectGridPainter
(
this
.
painter
);
final
void
Function
(
Canvas
canvas
,
Size
size
)
painter
;
@override
void
paint
(
Canvas
canvas
,
Size
size
)
=>
painter
(
canvas
,
size
);
@override
bool
shouldRepaint
(
CustomPainter
oldDelegate
)
=>
true
;
}
Map
<
String
,
WidgetBuilder
>
opacityPeepholeRoutes
=
<
String
,
WidgetBuilder
>{
for
(
OpacityPeepholeCase
variant
in
allOpacityPeepholeCases
)
variant
.
route
:
variant
.
buildPage
,
...
...
dev/benchmarks/macrobenchmarks/test/opacity_peephole_col_of_alpha_savelayer_rows_perf_e2e.dart
0 → 100644
View file @
9c934041
// 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:macrobenchmarks/common.dart'
;
import
'util.dart'
;
void
main
(
)
{
macroPerfTestMultiPageE2E
(
'opacity_peephole_col_of_alpha_save_layer_rows'
,
<
ScrollableButtonRoute
>[
ScrollableButtonRoute
(
kScrollableName
,
kOpacityPeepholeRouteName
),
ScrollableButtonRoute
(
kOpacityScrollableName
,
kOpacityPeepholeColumnOfAlphaSaveLayerRowsOfRectsRouteName
),
],
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
}
dev/benchmarks/macrobenchmarks/test/opacity_peephole_grid_of_alpha_savelayers_perf_e2e.dart
0 → 100644
View file @
9c934041
// 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:macrobenchmarks/common.dart'
;
import
'util.dart'
;
void
main
(
)
{
macroPerfTestMultiPageE2E
(
'opacity_peephole_grid_of_alpha_savelayers'
,
<
ScrollableButtonRoute
>[
ScrollableButtonRoute
(
kScrollableName
,
kOpacityPeepholeRouteName
),
ScrollableButtonRoute
(
kOpacityScrollableName
,
kOpacityPeepholeGridOfAlphaSaveLayerRectsRouteName
),
],
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
}
dev/devicelab/bin/tasks/opacity_peephole_col_of_alpha_savelayer_rows_perf__e2e_summary.dart
0 → 100644
View file @
9c934041
// 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/devices.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createOpacityPeepholeColOfAlphaSaveLayerRowsPerfE2ETest
());
}
dev/devicelab/bin/tasks/opacity_peephole_grid_of_alpha_savelayers_perf__e2e_summary.dart
0 → 100644
View file @
9c934041
// 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/devices.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createOpacityPeepholeGridOfAlphaSaveLayersPerfE2ETest
());
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
9c934041
...
...
@@ -519,6 +519,20 @@ TaskFunction createOpacityPeepholeFadeTransitionTextPerfE2ETest() {
).
run
;
}
TaskFunction
createOpacityPeepholeGridOfAlphaSaveLayersPerfE2ETest
(
)
{
return
PerfTest
.
e2e
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test/opacity_peephole_grid_of_alpha_savelayers_perf_e2e.dart'
,
).
run
;
}
TaskFunction
createOpacityPeepholeColOfAlphaSaveLayerRowsPerfE2ETest
(
)
{
return
PerfTest
.
e2e
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test/opacity_peephole_col_of_alpha_savelayer_rows_perf_e2e.dart'
,
).
run
;
}
Map
<
String
,
dynamic
>
_average
(
List
<
Map
<
String
,
dynamic
>>
results
,
int
iterations
)
{
final
Map
<
String
,
dynamic
>
tally
=
<
String
,
dynamic
>{};
for
(
final
Map
<
String
,
dynamic
>
item
in
results
)
{
...
...
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