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
304b9c66
Unverified
Commit
304b9c66
authored
May 15, 2021
by
Dan Field
Committed by
GitHub
May 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reland GC tracking benchmarks (#82069)
parent
9805df89
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
8 deletions
+67
-8
animated_image_test.dart
...arks/macrobenchmarks/test_driver/animated_image_test.dart
+1
-1
animated_image_gc_perf.dart
dev/devicelab/bin/tasks/animated_image_gc_perf.dart
+4
-1
gallery.dart
dev/devicelab/lib/tasks/gallery.dart
+1
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+4
-0
frame_timing_summarizer.dart
packages/flutter_test/lib/src/frame_timing_summarizer.dart
+17
-1
integration_test.dart
packages/integration_test/lib/integration_test.dart
+40
-5
No files found.
dev/benchmarks/macrobenchmarks/test_driver/animated_image_test.dart
View file @
304b9c66
...
...
@@ -6,7 +6,7 @@ import 'package:flutter_driver/flutter_driver.dart';
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
Future
<
void
>
main
()
async
{
const
String
fileName
=
'
large_image_changer
'
;
const
String
fileName
=
'
animated_image
'
;
test
(
'Animate for 250 frames'
,
()
async
{
final
FlutterDriver
driver
=
await
FlutterDriver
.
connect
();
...
...
dev/devicelab/bin/tasks/animated_image_gc_perf.dart
View file @
304b9c66
...
...
@@ -9,8 +9,11 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
DevToolsMemory
Test
(
await
task
(
Perf
Test
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test_driver/animated_image.dart'
,
'animated_image'
,
measureCpuGpu:
true
,
measureMemory:
true
,
).
run
);
}
dev/devicelab/lib/tasks/gallery.dart
View file @
304b9c66
...
...
@@ -87,6 +87,7 @@ class GalleryTransitionTest {
:
'
${testFile}
_test'
);
section
(
'DRIVE START'
);
await
flutter
(
'drive'
,
options:
<
String
>[
'--no-dds'
,
'--profile'
,
if
(
needFullTimeline
)
'--trace-startup'
,
...
...
dev/devicelab/lib/tasks/perf_tests.dart
View file @
304b9c66
...
...
@@ -705,6 +705,7 @@ class PerfTest {
final
String
deviceId
=
device
.
deviceId
;
await
flutter
(
'drive'
,
options:
<
String
>[
'--no-dds'
,
// TODO(dnfield): consider removing when https://github.com/flutter/flutter/issues/81707 is fixed
'--no-android-gradle-daemon'
,
'-v'
,
'--verbose-system-logs'
,
...
...
@@ -777,6 +778,8 @@ const List<String> _kCommonScoreKeys = <String>[
'worst_frame_rasterizer_time_millis'
,
'90th_percentile_frame_rasterizer_time_millis'
,
'99th_percentile_frame_rasterizer_time_millis'
,
'new_gen_gc_count'
,
'old_gen_gc_count'
,
];
class
PerfTestWithSkSL
extends
PerfTest
{
...
...
@@ -868,6 +871,7 @@ class PerfTestWithSkSL extends PerfTest {
_flutterPath
,
<
String
>[
'run'
,
'--no-dds'
,
if
(
deviceOperatingSystem
==
DeviceOperatingSystem
.
ios
)
...<
String
>[
'--device-timeout'
,
'5'
,
...
...
packages/flutter_test/lib/src/frame_timing_summarizer.dart
View file @
304b9c66
...
...
@@ -17,7 +17,11 @@ class FrameTimingSummarizer {
/// Summarize `data` to frame build time and frame rasterizer time statistics.
///
/// See [TimelineSummary.summaryJson] for detail.
factory
FrameTimingSummarizer
(
List
<
FrameTiming
>
data
)
{
factory
FrameTimingSummarizer
(
List
<
FrameTiming
>
data
,
{
int
?
newGenGCCount
,
int
?
oldGenGCCount
,
})
{
assert
(
data
!=
null
);
assert
(
data
.
isNotEmpty
);
final
List
<
Duration
>
frameBuildTime
=
List
<
Duration
>.
unmodifiable
(
...
...
@@ -58,6 +62,8 @@ class FrameTimingSummarizer {
p90VsyncOverhead:
_findPercentile
(
vsyncOverheadSorted
,
0.90
),
p99VsyncOverhead:
_findPercentile
(
vsyncOverheadSorted
,
0.99
),
worstVsyncOverhead:
vsyncOverheadSorted
.
last
,
newGenGCCount:
newGenGCCount
??
-
1
,
oldGenGCCount:
oldGenGCCount
??
-
1
,
);
}
...
...
@@ -79,6 +85,8 @@ class FrameTimingSummarizer {
required
this
.
p90VsyncOverhead
,
required
this
.
p99VsyncOverhead
,
required
this
.
worstVsyncOverhead
,
required
this
.
newGenGCCount
,
required
this
.
oldGenGCCount
,
});
/// List of frame build time in microseconds
...
...
@@ -133,6 +141,12 @@ class FrameTimingSummarizer {
/// The largest value of [vsyncOverhead] in milliseconds.
final
Duration
worstVsyncOverhead
;
/// The number of new generation GCs.
final
int
newGenGCCount
;
/// The number of old generation GCs.
final
int
oldGenGCCount
;
/// Convert the summary result to a json object.
///
/// See [TimelineSummary.summaryJson] for detail.
...
...
@@ -162,6 +176,8 @@ class FrameTimingSummarizer {
'frame_rasterizer_times'
:
frameRasterizerTime
.
map
<
int
>((
Duration
datum
)
=>
datum
.
inMicroseconds
)
.
toList
(),
'new_gen_gc_count'
:
newGenGCCount
,
'old_gen_gc_count'
:
oldGenGCCount
,
};
}
...
...
packages/integration_test/lib/integration_test.dart
View file @
304b9c66
...
...
@@ -228,8 +228,7 @@ https://flutter.dev/docs/testing/integration-tests#testing-on-firebase-test-lab
_vmService
=
vmService
;
}
if
(
_vmService
==
null
)
{
final
developer
.
ServiceProtocolInfo
info
=
await
developer
.
Service
.
getInfo
();
final
developer
.
ServiceProtocolInfo
info
=
await
developer
.
Service
.
getInfo
();
assert
(
info
.
serverUri
!=
null
);
_vmService
=
await
vm_io
.
vmServiceConnectUri
(
'ws://localhost:
${info.serverUri!.port}${info.serverUri!.path}
ws'
,
...
...
@@ -302,6 +301,29 @@ https://flutter.dev/docs/testing/integration-tests#testing-on-firebase-test-lab
reportData
![
reportKey
]
=
timeline
.
toJson
();
}
Future
<
_GarbageCollectionInfo
>
_runAndGetGCInfo
(
Future
<
void
>
Function
()
action
)
async
{
if
(
kIsWeb
)
{
await
action
();
return
const
_GarbageCollectionInfo
();
}
final
vm
.
Timeline
timeline
=
await
traceTimeline
(
action
,
streams:
<
String
>[
'GC'
],
);
final
int
oldGenGCCount
=
timeline
.
traceEvents
!.
where
((
vm
.
TimelineEvent
event
)
{
return
event
.
json
![
'cat'
]
==
'GC'
&&
event
.
json
![
'name'
]
==
'CollectOldGeneration'
;
}).
length
;
final
int
newGenGCCount
=
timeline
.
traceEvents
!.
where
((
vm
.
TimelineEvent
event
)
{
return
event
.
json
![
'cat'
]
==
'GC'
&&
event
.
json
![
'name'
]
==
'CollectNewGeneration'
;
}).
length
;
return
_GarbageCollectionInfo
(
oldCount:
oldGenGCCount
,
newCount:
newGenGCCount
,
);
}
/// Watches the [FrameTiming] during `action` and report it to the binding
/// with key `reportKey`.
///
...
...
@@ -340,11 +362,16 @@ https://flutter.dev/docs/testing/integration-tests#testing-on-firebase-test-lab
await
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
2
));
// flush old FrameTimings
final
TimingsCallback
watcher
=
frameTimings
.
addAll
;
addTimingsCallback
(
watcher
);
await
action
();
final
_GarbageCollectionInfo
gcInfo
=
await
_runAndGetGCInfo
(
action
);
await
delayForFrameTimings
();
// make sure all FrameTimings are reported
removeTimingsCallback
(
watcher
);
final
FrameTimingSummarizer
frameTimes
=
FrameTimingSummarizer
(
frameTimings
);
final
FrameTimingSummarizer
frameTimes
=
FrameTimingSummarizer
(
frameTimings
,
newGenGCCount:
gcInfo
.
newCount
,
oldGenGCCount:
gcInfo
.
oldCount
,
);
reportData
??=
<
String
,
dynamic
>{};
reportData
![
reportKey
]
=
frameTimes
.
summary
;
}
...
...
@@ -381,3 +408,11 @@ https://flutter.dev/docs/testing/integration-tests#testing-on-firebase-test-lab
// `LiveTestWidgetsFlutterBinding` https://github.com/flutter/flutter/issues/81534
}
}
@immutable
class
_GarbageCollectionInfo
{
const
_GarbageCollectionInfo
({
this
.
oldCount
=
-
1
,
this
.
newCount
=
-
1
});
final
int
oldCount
;
final
int
newCount
;
}
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