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
08a2635e
Unverified
Commit
08a2635e
authored
Dec 02, 2022
by
Jonah Williams
Committed by
GitHub
Dec 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[devicelab] add benchmark for complex non-intersecting widgets with platform views (#116436)
parent
4643f833
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
237 additions
and
4 deletions
+237
-4
.ci.yaml
.ci.yaml
+10
-0
TESTOWNERS
TESTOWNERS
+1
-0
project.pbxproj
...latform_views_layout/ios/Runner.xcodeproj/project.pbxproj
+13
-4
main_non_intersecting.dart
...arks/platform_views_layout/lib/main_non_intersecting.dart
+115
-0
scroll_perf_non_intersecting_test.dart
...layout/test_driver/scroll_perf_non_intersecting_test.dart
+62
-0
uikit_view_scroll_perf_non_intersecting.dart
.../test_driver/uikit_view_scroll_perf_non_intersecting.dart
+13
-0
platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary.dart
...perf_non_intersecting_impeller_ios__timeline_summary.dart
+12
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+11
-0
No files found.
.ci.yaml
View file @
08a2635e
...
...
@@ -3714,6 +3714,16 @@ targets:
["devicelab", "ios", "mac"]
task_name
:
platform_views_scroll_perf_impeller_ios__timeline_summary
-
name
:
Mac_ios platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary
recipe
:
devicelab/devicelab_drone
presubmit
:
false
bringup
:
true
timeout
:
60
properties
:
tags
:
>
["devicelab", "ios", "mac"]
task_name
:
platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary
-
name
:
Mac_ios post_backdrop_filter_perf_ios__timeline_summary
recipe
:
devicelab/devicelab_drone
presubmit
:
false
...
...
TESTOWNERS
View file @
08a2635e
...
...
@@ -196,6 +196,7 @@
/dev/devicelab/bin/tasks/platform_interaction_test_ios.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/platform_view_ios__start_up.dart @stuartmorgan @flutter/plugin
/dev/devicelab/bin/tasks/platform_views_scroll_perf_impeller_ios__timeline_summary.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary.dart @jonahwilliams @flutter/engine
/dev/devicelab/bin/tasks/platform_views_scroll_perf_ios__timeline_summary.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/post_backdrop_filter_perf_ios__timeline_summary.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/route_test_ios.dart @jasguerrero @flutter/tool
...
...
dev/benchmarks/platform_views_layout/ios/Runner.xcodeproj/project.pbxproj
View file @
08a2635e
...
...
@@ -77,7 +77,6 @@
9740EEB11CF90186004384FC
/* Flutter */
,
97C146F01CF9000F007C117D
/* Runner */
,
97C146EF1CF9000F007C117D
/* Products */
,
CF3B75C9A7D2FA2A4C99F110
/* Frameworks */
,
);
sourceTree
=
"<group>"
;
};
...
...
@@ -309,7 +308,10 @@
CURRENT_PROJECT_VERSION
=
"$(FLUTTER_BUILD_NUMBER)"
;
ENABLE_BITCODE
=
NO
;
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.yourcompany.platformViewsLayout
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
...
...
@@ -427,9 +429,13 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CURRENT_PROJECT_VERSION
=
"$(FLUTTER_BUILD_NUMBER)"
;
DEVELOPMENT_TEAM
=
S8QB4VV633
;
ENABLE_BITCODE
=
NO
;
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.yourcompany.platformViewsLayout
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
...
...
@@ -444,7 +450,10 @@
CURRENT_PROJECT_VERSION
=
"$(FLUTTER_BUILD_NUMBER)"
;
ENABLE_BITCODE
=
NO
;
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.yourcompany.platformViewsLayout
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
...
...
dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart
0 → 100644
View file @
08a2635e
// 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:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
show
timeDilation
;
void
main
(
)
{
runApp
(
const
PlatformViewApp
()
);
}
class
PlatformViewApp
extends
StatefulWidget
{
const
PlatformViewApp
({
super
.
key
,
});
@override
PlatformViewAppState
createState
()
=>
PlatformViewAppState
();
}
class
PlatformViewAppState
extends
State
<
PlatformViewApp
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
theme:
ThemeData
.
light
(),
title:
'Advanced Layout'
,
home:
const
PlatformViewLayout
(),
);
}
void
toggleAnimationSpeed
()
{
setState
(()
{
timeDilation
=
(
timeDilation
!=
1.0
)
?
1.0
:
5.0
;
});
}
}
class
PlatformViewLayout
extends
StatelessWidget
{
const
PlatformViewLayout
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Platform View Scrolling Layout'
)),
body:
ListView
.
builder
(
key:
const
Key
(
'platform-views-scroll'
),
// This key is used by the driver test.
itemCount:
200
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
Padding
(
padding:
const
EdgeInsets
.
all
(
5.0
),
child:
Material
(
elevation:
(
index
%
5
+
1
).
toDouble
(),
color:
Colors
.
white
,
child:
index
.
isEven
?
CustomPaint
(
painter:
ExpensivePainter
(),
size:
const
Size
(
400
,
200
))
:
const
DummyPlatformView
()
),
);
},
),
);
}
}
class
DummyPlatformView
extends
StatelessWidget
{
const
DummyPlatformView
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
const
String
viewType
=
'benchmarks/platform_views_layout/DummyPlatformView'
;
late
Widget
nativeView
;
if
(
Platform
.
isIOS
)
{
nativeView
=
const
UiKitView
(
viewType:
viewType
,
);
}
else
if
(
Platform
.
isAndroid
)
{
nativeView
=
const
AndroidView
(
viewType:
viewType
,
);
}
else
{
assert
(
false
,
'Invalid platform'
);
}
return
Container
(
color:
Colors
.
purple
,
height:
200.0
,
child:
nativeView
,
);
}
}
class
ExpensivePainter
extends
CustomPainter
{
@override
void
paint
(
Canvas
canvas
,
Size
size
)
{
final
double
boxWidth
=
size
.
width
/
50
;
final
double
boxHeight
=
size
.
height
/
50
;
for
(
int
i
=
0
;
i
<
50
;
i
++)
{
for
(
int
j
=
0
;
j
<
50
;
j
++)
{
final
Rect
rect
=
Rect
.
fromLTWH
(
i
*
boxWidth
,
j
*
boxHeight
,
boxWidth
,
boxHeight
);
canvas
.
drawRect
(
rect
,
Paint
()
..
style
=
PaintingStyle
.
fill
..
color
=
Colors
.
red
);
}
}
}
@override
bool
shouldRepaint
(
covariant
CustomPainter
oldDelegate
)
{
return
false
;
}
}
dev/benchmarks/platform_views_layout/test_driver/scroll_perf_non_intersecting_test.dart
0 → 100644
View file @
08a2635e
// 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_driver/flutter_driver.dart'
;
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
void
main
(
)
{
group
(
'scrolling performance test'
,
()
{
late
FlutterDriver
driver
;
setUpAll
(()
async
{
driver
=
await
FlutterDriver
.
connect
();
await
driver
.
waitUntilFirstFrameRasterized
();
});
tearDownAll
(()
async
{
driver
.
close
();
});
Future
<
void
>
testScrollPerf
(
String
listKey
,
String
summaryName
)
async
{
// The slight initial delay avoids starting the timing during a
// period of increased load on the device. Without this delay, the
// benchmark has greater noise.
// See: https://github.com/flutter/flutter/issues/19434
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
250
));
await
driver
.
forceGC
();
final
Timeline
timeline
=
await
driver
.
traceAction
(()
async
{
// Find the scrollable stock list
final
SerializableFinder
list
=
find
.
byValueKey
(
listKey
);
expect
(
list
,
isNotNull
);
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
// Scroll down
for
(
int
i
=
0
;
i
<
5
;
i
+=
1
)
{
await
driver
.
scroll
(
list
,
0.0
,
-
300.0
,
const
Duration
(
milliseconds:
300
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
500
));
}
// Scroll up
for
(
int
i
=
0
;
i
<
5
;
i
+=
1
)
{
await
driver
.
scroll
(
list
,
0.0
,
300.0
,
const
Duration
(
milliseconds:
300
));
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
500
));
}
}
});
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeTimelineToFile
(
summaryName
,
pretty:
true
);
}
test
(
'platform_views_scroll_perf'
,
()
async
{
// Disable frame sync, since there are ongoing animations.
await
driver
.
runUnsynchronized
(()
async
{
await
testScrollPerf
(
'platform-views-scroll'
,
'platform_views_scroll_perf_non_intersecting'
);
});
},
timeout:
Timeout
.
none
);
});
}
dev/benchmarks/platform_views_layout/test_driver/uikit_view_scroll_perf_non_intersecting.dart
0 → 100644
View file @
08a2635e
// 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/widgets.dart'
;
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:platform_views_layout/main_non_intersecting.dart'
as
app
;
void
main
(
)
{
enableFlutterDriverExtension
();
runApp
(
const
app
.
PlatformViewApp
());
}
dev/devicelab/bin/tasks/platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary.dart
0 → 100644
View file @
08a2635e
// 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_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
.
ios
;
await
task
(
createUiKitViewScrollPerfNonIntersectingTest
(
enableImpeller:
true
));
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
08a2635e
...
...
@@ -59,6 +59,17 @@ TaskFunction createUiKitViewScrollPerfTest({bool enableImpeller = false}) {
).
run
;
}
TaskFunction
createUiKitViewScrollPerfNonIntersectingTest
(
{
bool
enableImpeller
=
false
})
{
return
PerfTest
(
'
${flutterDirectory.path}
/dev/benchmarks/platform_views_layout'
,
'test_driver/uikit_view_scroll_perf_non_intersecting.dart'
,
'platform_views_scroll_perf_non_intersecting'
,
testDriver:
'test_driver/scroll_perf_non_intersecting_test.dart'
,
needsFullTimeline:
false
,
enableImpeller:
enableImpeller
,
).
run
;
}
TaskFunction
createAndroidTextureScrollPerfTest
(
)
{
return
PerfTest
(
'
${flutterDirectory.path}
/dev/benchmarks/platform_views_layout'
,
...
...
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