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
ee204880
Unverified
Commit
ee204880
authored
Dec 01, 2021
by
Jim Graham
Committed by
GitHub
Dec 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Opacity Peephole optimization benchmarks (#94447)
parent
fff85f9c
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
607 additions
and
12 deletions
+607
-12
.ci.yaml
.ci.yaml
+50
-0
TESTOWNERS
TESTOWNERS
+5
-0
common.dart
dev/benchmarks/macrobenchmarks/lib/common.dart
+10
-0
main.dart
dev/benchmarks/macrobenchmarks/lib/main.dart
+10
-0
opacity_peephole.dart
dev/benchmarks/macrobenchmarks/lib/src/opacity_peephole.dart
+332
-0
opacity_peephole_col_of_rows_perf_e2e.dart
...enchmarks/test/opacity_peephole_col_of_rows_perf_e2e.dart
+16
-0
opacity_peephole_fade_transition_text_perf_e2e.dart
.../test/opacity_peephole_fade_transition_text_perf_e2e.dart
+16
-0
opacity_peephole_grid_of_opacity_perf_e2e.dart
...marks/test/opacity_peephole_grid_of_opacity_perf_e2e.dart
+16
-0
opacity_peephole_one_rect_perf_e2e.dart
...robenchmarks/test/opacity_peephole_one_rect_perf_e2e.dart
+16
-0
opacity_peephole_opacity_of_grid_perf_e2e.dart
...marks/test/opacity_peephole_opacity_of_grid_perf_e2e.dart
+16
-0
util.dart
dev/benchmarks/macrobenchmarks/test/util.dart
+15
-12
opacity_peephole_col_of_rows_perf__e2e_summary.dart
...tasks/opacity_peephole_col_of_rows_perf__e2e_summary.dart
+14
-0
opacity_peephole_fade_transition_text_perf__e2e_summary.dart
...city_peephole_fade_transition_text_perf__e2e_summary.dart
+14
-0
opacity_peephole_grid_of_opacity_perf__e2e_summary.dart
...s/opacity_peephole_grid_of_opacity_perf__e2e_summary.dart
+14
-0
opacity_peephole_one_rect_perf__e2e_summary.dart
...in/tasks/opacity_peephole_one_rect_perf__e2e_summary.dart
+14
-0
opacity_peephole_opacity_of_grid_perf__e2e_summary.dart
...s/opacity_peephole_opacity_of_grid_perf__e2e_summary.dart
+14
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+35
-0
No files found.
.ci.yaml
View file @
ee204880
...
...
@@ -1863,6 +1863,56 @@ targets:
timeout
:
60
scheduler
:
luci
-
name
:
Linux_android opacity_peephole_one_rect_perf__e2e_summary
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
properties
:
tags
:
>
["devicelab","android","linux"]
task_name
:
opacity_peephole_one_rect_perf__e2e_summary
scheduler
:
luci
-
name
:
Linux_android opacity_peephole_col_of_rows_perf__e2e_summary
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
properties
:
tags
:
>
["devicelab","android","linux"]
task_name
:
opacity_peephole_col_of_rows_perf__e2e_summary
scheduler
:
luci
-
name
:
Linux_android opacity_peephole_opacity_of_grid_perf__e2e_summary
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
properties
:
tags
:
>
["devicelab","android","linux"]
task_name
:
opacity_peephole_opacity_of_grid_perf__e2e_summary
scheduler
:
luci
-
name
:
Linux_android opacity_peephole_grid_of_opacity_perf__e2e_summary
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
properties
:
tags
:
>
["devicelab","android","linux"]
task_name
:
opacity_peephole_grid_of_opacity_perf__e2e_summary
scheduler
:
luci
-
name
:
Linux_android opacity_peephole_fade_transition_text_perf__e2e_summary
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
properties
:
tags
:
>
["devicelab","android","linux"]
task_name
:
opacity_peephole_fade_transition_text_perf__e2e_summary
scheduler
:
luci
-
name
:
Mac build_aar_module_test
recipe
:
devicelab/devicelab_drone
timeout
:
60
...
...
TESTOWNERS
View file @
ee204880
...
...
@@ -61,6 +61,11 @@
/dev/devicelab/bin/tasks/routing_test.dart @zanderso @flutter/tool
/dev/devicelab/bin/tasks/textfield_perf__e2e_summary.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/web_size__compile_test.dart @yjbanov @flutter/web
/dev/devicelab/bin/tasks/opacity_peephole_col_of_rows_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_grid_of_opacity_perf__e2e_summary.dart @flar @flutter/engine
/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
## 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 @
ee204880
...
...
@@ -22,6 +22,16 @@ const String kSimpleScrollRouteName = '/simple_scroll';
const
String
kStackSizeRouteName
=
'/stack_size'
;
const
String
kAnimationWithMicrotasksRouteName
=
'/animation_with_microtasks'
;
const
String
kAnimatedImageRouteName
=
'/animated_image'
;
const
String
kOpacityPeepholeRouteName
=
'/opacity_peephole'
;
const
String
kOpacityPeepholeOneRectRouteName
=
'
$kOpacityPeepholeRouteName
/one_big_rect'
;
const
String
kOpacityPeepholeColumnOfOpacityRouteName
=
'
$kOpacityPeepholeRouteName
/column_of_opacity'
;
const
String
kOpacityPeepholeOpacityOfCachedChildRouteName
=
'
$kOpacityPeepholeRouteName
/opacity_of_cached_child'
;
const
String
kOpacityPeepholeOpacityOfColumnRouteName
=
'
$kOpacityPeepholeRouteName
/opacity_of_column'
;
const
String
kOpacityPeepholeGridOfOpacityRouteName
=
'
$kOpacityPeepholeRouteName
/grid_of_opacity'
;
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
kScrollableName
=
'/macrobenchmark_listview'
;
...
...
dev/benchmarks/macrobenchmarks/lib/main.dart
View file @
ee204880
...
...
@@ -19,6 +19,7 @@ import 'src/heavy_grid_view.dart';
import
'src/large_image_changer.dart'
;
import
'src/large_images.dart'
;
import
'src/multi_widget_construction.dart'
;
import
'src/opacity_peephole.dart'
;
import
'src/picture_cache.dart'
;
import
'src/post_backdrop_filter.dart'
;
import
'src/simple_animation.dart'
;
...
...
@@ -60,6 +61,8 @@ class MacrobenchmarksApp extends StatelessWidget {
kStackSizeRouteName:
(
BuildContext
context
)
=>
const
StackSizePage
(),
kAnimationWithMicrotasksRouteName:
(
BuildContext
context
)
=>
const
AnimationWithMicrotasks
(),
kAnimatedImageRouteName:
(
BuildContext
context
)
=>
const
AnimatedImagePage
(),
kOpacityPeepholeRouteName:
(
BuildContext
context
)
=>
const
OpacityPeepholePage
(),
...
opacityPeepholeRoutes
,
},
);
}
...
...
@@ -210,6 +213,13 @@ class HomePage extends StatelessWidget {
Navigator
.
pushNamed
(
context
,
kAnimatedImageRouteName
);
},
),
ElevatedButton
(
key:
const
Key
(
kOpacityPeepholeRouteName
),
child:
const
Text
(
'Opacity Peephole tests'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
kOpacityPeepholeRouteName
);
},
),
],
),
);
...
...
dev/benchmarks/macrobenchmarks/lib/src/opacity_peephole.dart
0 → 100644
View file @
ee204880
This diff is collapsed.
Click to expand it.
dev/benchmarks/macrobenchmarks/test/opacity_peephole_col_of_rows_perf_e2e.dart
0 → 100644
View file @
ee204880
// 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
(
)
{
macroPerfTestE2E
(
'opacity_peephole_col_of_rows_perf'
,
kOpacityPeepholeOpacityOfColOfRowsRouteName
,
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
}
dev/benchmarks/macrobenchmarks/test/opacity_peephole_fade_transition_text_perf_e2e.dart
0 → 100644
View file @
ee204880
// 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
(
)
{
macroPerfTestE2E
(
'opacity_peephole_fade_transition_text_perf'
,
kOpacityPeepholeFadeTransitionTextRouteName
,
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
}
dev/benchmarks/macrobenchmarks/test/opacity_peephole_grid_of_opacity_perf_e2e.dart
0 → 100644
View file @
ee204880
// 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
(
)
{
macroPerfTestE2E
(
'opacity_peephole_grid_of_opacity_perf'
,
kOpacityPeepholeGridOfOpacityRouteName
,
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
}
dev/benchmarks/macrobenchmarks/test/opacity_peephole_one_rect_perf_e2e.dart
0 → 100644
View file @
ee204880
// 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
(
)
{
macroPerfTestE2E
(
'opacity_peephole_one_rect_perf'
,
kOpacityPeepholeOneRectRouteName
,
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
}
dev/benchmarks/macrobenchmarks/test/opacity_peephole_opacity_of_grid_perf_e2e.dart
0 → 100644
View file @
ee204880
// 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
(
)
{
macroPerfTestE2E
(
'opacity_peephole_opacity_of_grid_perf'
,
kOpacityPeepholeOpacityOfGridRouteName
,
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
}
dev/benchmarks/macrobenchmarks/test/util.dart
View file @
ee204880
...
...
@@ -5,7 +5,6 @@
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:integration_test/integration_test.dart'
;
import
'package:macrobenchmarks/common.dart'
;
import
'package:macrobenchmarks/main.dart'
as
app
;
typedef
ControlCallback
=
Future
<
void
>
Function
(
WidgetController
controller
);
...
...
@@ -34,17 +33,21 @@ void macroPerfTestE2E(
// See: https://github.com/flutter/flutter/issues/19434
await
tester
.
binding
.
delayed
(
const
Duration
(
microseconds:
250
));
final
Finder
scrollable
=
find
.
byKey
(
const
ValueKey
<
String
>(
kScrollableName
));
expect
(
scrollable
,
findsOneWidget
);
final
Finder
button
=
find
.
byKey
(
ValueKey
<
String
>(
routeName
),
skipOffstage:
false
);
await
tester
.
scrollUntilVisible
(
button
,
50
);
expect
(
button
,
findsOneWidget
);
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
button
);
// Cannot be pumpAndSettle because some tests have infinite animation.
await
tester
.
pump
(
const
Duration
(
milliseconds:
20
));
expect
(
routeName
,
startsWith
(
'/'
));
int
i
=
0
;
while
(
i
<
routeName
.
length
)
{
i
=
routeName
.
indexOf
(
'/'
,
i
+
1
);
if
(
i
<
0
)
{
i
=
routeName
.
length
;
}
final
Finder
button
=
find
.
byKey
(
ValueKey
<
String
>(
routeName
.
substring
(
0
,
i
)),
skipOffstage:
false
);
await
tester
.
scrollUntilVisible
(
button
,
50
);
expect
(
button
,
findsOneWidget
);
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
button
);
// Cannot be pumpAndSettle because some tests have infinite animation.
await
tester
.
pump
(
const
Duration
(
milliseconds:
20
));
}
if
(
pageDelay
!=
null
)
{
// Wait for the page to load
...
...
dev/devicelab/bin/tasks/opacity_peephole_col_of_rows_perf__e2e_summary.dart
0 → 100644
View file @
ee204880
// 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
(
createOpacityPeepholeColOfRowsPerfE2ETest
());
}
dev/devicelab/bin/tasks/opacity_peephole_fade_transition_text_perf__e2e_summary.dart
0 → 100644
View file @
ee204880
// 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
(
createOpacityPeepholeFadeTransitionTextPerfE2ETest
());
}
dev/devicelab/bin/tasks/opacity_peephole_grid_of_opacity_perf__e2e_summary.dart
0 → 100644
View file @
ee204880
// 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
(
createOpacityPeepholeGridOfOpacityPerfE2ETest
());
}
dev/devicelab/bin/tasks/opacity_peephole_one_rect_perf__e2e_summary.dart
0 → 100644
View file @
ee204880
// 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
(
createOpacityPeepholeOneRectPerfE2ETest
());
}
dev/devicelab/bin/tasks/opacity_peephole_opacity_of_grid_perf__e2e_summary.dart
0 → 100644
View file @
ee204880
// 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
(
createOpacityPeepholeOpacityOfGridPerfE2ETest
());
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
ee204880
...
...
@@ -484,6 +484,41 @@ TaskFunction createFramePolicyIntegrationTest() {
};
}
TaskFunction
createOpacityPeepholeOneRectPerfE2ETest
(
)
{
return
PerfTest
.
e2e
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test/opacity_peephole_one_rect_perf_e2e.dart'
,
).
run
;
}
TaskFunction
createOpacityPeepholeColOfRowsPerfE2ETest
(
)
{
return
PerfTest
.
e2e
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test/opacity_peephole_col_of_rows_perf_e2e.dart'
,
).
run
;
}
TaskFunction
createOpacityPeepholeOpacityOfGridPerfE2ETest
(
)
{
return
PerfTest
.
e2e
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test/opacity_peephole_opacity_of_grid_perf_e2e.dart'
,
).
run
;
}
TaskFunction
createOpacityPeepholeGridOfOpacityPerfE2ETest
(
)
{
return
PerfTest
.
e2e
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test/opacity_peephole_grid_of_opacity_perf_e2e.dart'
,
).
run
;
}
TaskFunction
createOpacityPeepholeFadeTransitionTextPerfE2ETest
(
)
{
return
PerfTest
.
e2e
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test/opacity_peephole_fade_transition_text_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