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
850ea6d2
Unverified
Commit
850ea6d2
authored
Jun 24, 2020
by
liyuqian
Committed by
GitHub
Jun 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SkSL shader warm-up tests to Flutter gallery (#59932)
parent
766e0fa9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
17 deletions
+102
-17
flutter_gallery_sksl_warmup__transition_perf.dart
...n/tasks/flutter_gallery_sksl_warmup__transition_perf.dart
+14
-0
flutter_gallery_sksl_warmup_ios32__transition_perf.dart
...s/flutter_gallery_sksl_warmup_ios32__transition_perf.dart
+14
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+58
-17
manifest.yaml
dev/devicelab/manifest.yaml
+16
-0
No files found.
dev/devicelab/bin/tasks/flutter_gallery_sksl_warmup__transition_perf.dart
0 → 100644
View file @
850ea6d2
// 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/tasks/perf_tests.dart'
;
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createFlutterGalleryTransitionsPerfSkSLWarmupTest
());
}
dev/devicelab/bin/tasks/flutter_gallery_sksl_warmup_ios32__transition_perf.dart
0 → 100644
View file @
850ea6d2
// 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/tasks/perf_tests.dart'
;
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
ios
;
await
task
(
createFlutterGalleryTransitionsPerfSkSLWarmupTest
());
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
850ea6d2
...
...
@@ -91,6 +91,14 @@ TaskFunction createCubicBezierPerfSkSLWarmupTest() {
).
run
;
}
TaskFunction
createFlutterGalleryTransitionsPerfSkSLWarmupTest
(
)
{
return
PerfTestWithSkSL
(
'
${flutterDirectory.path}
/dev/integration_tests/flutter_gallery'
,
'test_driver/transitions_perf.dart'
,
'transitions'
,
).
run
;
}
TaskFunction
createBackdropFilterPerfTest
(
{
bool
needsMeasureCpuGpu
=
false
})
{
return
PerfTest
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
...
...
@@ -296,8 +304,8 @@ class PerfTest {
@protected
Future
<
TaskResult
>
internalRun
({
bool
keepRunning
=
false
,
bool
cacheSkSL
=
false
,
bool
noBuild
=
false
,
String
existingApp
,
String
writeSkslFileName
,
})
{
...
...
@@ -309,10 +317,11 @@ class PerfTest {
await
flutter
(
'drive'
,
options:
<
String
>[
'-v'
,
'--verbose-system-logs'
,
'--profile'
,
'--trace-startup'
,
// Enables "endless" timeline event buffering.
'-t'
,
testTarget
,
'-t'
,
testTarget
,
if
(
noBuild
)
'--no-build'
,
if
(
testDriver
!=
null
)
...<
String
>[
'--driver'
,
testDriver
],
if
(
existingApp
!=
null
)
...
...
@@ -320,7 +329,6 @@ class PerfTest {
if
(
writeSkslFileName
!=
null
)
...<
String
>[
'--write-sksl-on-exit'
,
writeSkslFileName
],
if
(
cacheSkSL
)
'--cache-sksl'
,
if
(
keepRunning
)
'--keep-app-running'
,
'-d'
,
deviceId
,
]);
...
...
@@ -401,23 +409,29 @@ class PerfTestWithSkSL extends PerfTest {
}
Future
<
void
>
_generateSkSL
()
async
{
// `flutter drive` without `flutter run`, and `flutter drive --existing-app`
// with `flutter run` may generate different SkSLs. Hence we run both
// versions to generate as many SkSLs as possible.
//
// 1st, `flutter drive --existing-app` with `flutter run`. The
// `--write-sksl-on-exit` option doesn't seem to be compatible with
// `flutter drive --existing-app` as it will complain web socket connection
// issues.
final
String
observatoryUri
=
await
_runApp
(
cacheSkSL:
true
);
await
super
.
internalRun
(
cacheSkSL:
true
,
existingApp:
observatoryUri
);
_runProcess
.
kill
();
await
_runProcess
.
exitCode
;
// 2nd, `flutter drive` without `flutter run`. The --no-build option ensures
// that we won't remove the SkSLs generated earlier.
await
super
.
internalRun
(
keepRunning:
true
,
cacheSkSL:
true
,
noBuild:
true
,
writeSkslFileName:
_skslJsonFileName
,
);
}
// Return the VMService URI.
Future
<
String
>
_buildAndRun
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
// TODO(liyuqian): also supports iOS once https://github.com/flutter/flutter/issues/53115 is fully closed.
'apk'
,
'--profile'
,
'--bundle-sksl-path'
,
_skslJsonFileName
,
'-t'
,
testTarget
,
]);
Future
<
String
>
_runApp
({
String
appBinary
,
bool
cacheSkSL
=
false
})
async
{
if
(
File
(
_vmserviceFileName
).
existsSync
())
{
File
(
_vmserviceFileName
).
deleteSync
();
}
...
...
@@ -427,12 +441,13 @@ class PerfTestWithSkSL extends PerfTest {
<
String
>[
'run'
,
'--verbose'
,
'--verbose-system-logs'
,
'--profile'
,
if
(
cacheSkSL
)
'--cache-sksl'
,
'-d'
,
_device
.
deviceId
,
'-t'
,
testTarget
,
'--endless-trace-buffer'
,
'--use-application-binary'
,
'
$testDirectory
/build/app/outputs/flutter-apk/app-profile.apk'
,
if
(
appBinary
!=
null
)
...<
String
>[
'--use-application-binary'
,
_appBinary
],
'--vmservice-out-file'
,
_vmserviceFileName
,
],
);
...
...
@@ -445,9 +460,35 @@ class PerfTestWithSkSL extends PerfTest {
return
file
.
readAsStringSync
();
}
// Return the VMService URI.
Future
<
String
>
_buildAndRun
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
if
(
_isAndroid
)
'apk'
else
'ios'
,
'--profile'
,
'--bundle-sksl-path'
,
_skslJsonFileName
,
'-t'
,
testTarget
,
]);
return
_runApp
(
appBinary:
_appBinary
);
}
String
get
_skslJsonFileName
=>
'
$testDirectory
/flutter_01.sksl.json'
;
String
get
_vmserviceFileName
=>
'
$testDirectory
/
$_kVmserviceOutFileName
'
;
bool
get
_isAndroid
=>
deviceOperatingSystem
==
DeviceOperatingSystem
.
android
;
String
get
_appBinary
{
if
(
_isAndroid
)
{
return
'
$testDirectory
/build/app/outputs/flutter-apk/app-profile.apk'
;
}
for
(
final
FileSystemEntity
entry
in
Directory
(
'
$testDirectory
/build/ios/iphoneos/'
).
listSync
())
{
if
(
entry
.
path
.
endsWith
(
'.app'
))
{
return
entry
.
path
;
}
}
throw
'No app found.'
;
}
Stream
<
String
>
_transform
(
Stream
<
List
<
int
>>
stream
)
=>
stream
.
transform
<
String
>(
utf8
.
decoder
).
transform
<
String
>(
const
LineSplitter
());
...
...
dev/devicelab/manifest.yaml
View file @
850ea6d2
...
...
@@ -175,6 +175,14 @@ tasks:
stage
:
devicelab
required_agent_capabilities
:
[
"
mac/android"
]
flutter_gallery_sksl_warmup_ios32__transition_perf
:
description
:
>
Measures the runtime performance of Flutter gallery transitions on iPhone4s
with SkSL shader warm-up.
stage
:
devicelab
required_agent_capabilities
:
[
"
mac/ios32"
]
flaky
:
true
backdrop_filter_perf__timeline_summary
:
description
:
>
Measures the runtime performance of backdrop filter blurs on Android.
...
...
@@ -739,6 +747,14 @@ tasks:
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
flutter_gallery_sksl_warmup__transition_perf
:
description
:
>
Measures the runtime performance of Flutter gallery transitions on Android
with SkSL shader warm-up.
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
flaky
:
true
flutter_gallery__transition_perf_with_semantics
:
description
:
>
Measures the delta in performance of screen transitions without and
...
...
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