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
cf00b969
Unverified
Commit
cf00b969
authored
Dec 28, 2019
by
Jim Graham
Committed by
GitHub
Dec 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix semantics and transition-perf tests to parse new event format. (#47899)
parent
4f23c434
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
semantics_perf_test.dart
...marks/complex_layout/test_driver/semantics_perf_test.dart
+3
-3
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+14
-4
No files found.
dev/benchmarks/complex_layout/test_driver/semantics_perf_test.dart
View file @
cf00b969
...
...
@@ -34,9 +34,9 @@ void main() {
});
final
Iterable
<
TimelineEvent
>
semanticsEvents
=
timeline
.
events
.
where
((
TimelineEvent
event
)
=>
event
.
name
==
'Semantics'
);
if
(
semanticsEvents
.
length
!=
1
)
fail
(
'Expected exactly
one semantics event
, got
${semanticsEvents.length}
'
);
final
Duration
semanticsTreeCreation
=
semanticsEvents
.
first
.
duration
;
if
(
semanticsEvents
.
length
!=
2
)
fail
(
'Expected exactly
two semantics events
, got
${semanticsEvents.length}
'
);
final
Duration
semanticsTreeCreation
=
Duration
(
microseconds:
semanticsEvents
.
last
.
timestampMicros
-
semanticsEvents
.
first
.
timestampMicros
)
;
final
String
jsonEncoded
=
json
.
encode
(<
String
,
dynamic
>{
'initialSemanticsTreeCreation'
:
semanticsTreeCreation
.
inMilliseconds
});
File
(
p
.
join
(
testOutputsDirectory
,
'complex_layout_semantics_perf.json'
)).
writeAsStringSync
(
jsonEncoded
);
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
cf00b969
...
...
@@ -66,6 +66,7 @@ List<String> _allDemos = <String>[];
Future
<
void
>
saveDurationsHistogram
(
List
<
Map
<
String
,
dynamic
>>
events
,
String
outputPath
)
async
{
final
Map
<
String
,
List
<
int
>>
durations
=
<
String
,
List
<
int
>>{};
Map
<
String
,
dynamic
>
startEvent
;
int
frameStart
;
// Save the duration of the first frame after each 'Start Transition' event.
for
(
Map
<
String
,
dynamic
>
event
in
events
)
{
...
...
@@ -74,10 +75,19 @@ Future<void> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
assert
(
startEvent
==
null
);
startEvent
=
event
;
}
else
if
(
startEvent
!=
null
&&
eventName
==
'Frame'
)
{
final
String
routeName
=
startEvent
[
'args'
][
'to'
]
as
String
;
durations
[
routeName
]
??=
<
int
>[];
durations
[
routeName
].
add
(
event
[
'dur'
]
as
int
);
startEvent
=
null
;
final
String
phase
=
event
[
'ph'
]
as
String
;
final
int
timestamp
=
event
[
'ts'
]
as
int
;
if
(
phase
==
'B'
)
{
assert
(
frameStart
==
null
);
frameStart
=
timestamp
;
}
else
{
assert
(
phase
==
'E'
);
final
String
routeName
=
startEvent
[
'args'
][
'to'
]
as
String
;
durations
[
routeName
]
??=
<
int
>[];
durations
[
routeName
].
add
(
timestamp
-
frameStart
);
startEvent
=
null
;
frameStart
=
null
;
}
}
}
...
...
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