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
f59a6770
Commit
f59a6770
authored
May 23, 2017
by
yjbanov
Committed by
Yegor
May 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
track debug build times; switch from --profile to --release
parent
307f3569
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
18 deletions
+51
-18
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+51
-18
No files found.
dev/devicelab/lib/tasks/perf_tests.dart
View file @
f59a6770
...
@@ -177,6 +177,8 @@ class PerfTest {
...
@@ -177,6 +177,8 @@ class PerfTest {
}
}
}
}
/// Measures how long it takes to build a Flutter app and how big the compiled
/// code is.
class
BuildTest
{
class
BuildTest
{
BuildTest
(
this
.
testDirectory
);
BuildTest
(
this
.
testDirectory
);
...
@@ -189,27 +191,58 @@ class BuildTest {
...
@@ -189,27 +191,58 @@ class BuildTest {
await
device
.
unlock
();
await
device
.
unlock
();
await
flutter
(
'packages'
,
options:
<
String
>[
'get'
]);
await
flutter
(
'packages'
,
options:
<
String
>[
'get'
]);
final
Map
<
String
,
dynamic
>
aotResults
=
await
_buildAot
();
final
Map
<
String
,
dynamic
>
debugResults
=
await
_buildDebug
();
final
Map
<
String
,
dynamic
>
metrics
=
<
String
,
dynamic
>{}
..
addAll
(
aotResults
)
..
addAll
(
debugResults
);
return
new
TaskResult
.
success
(
metrics
,
benchmarkScoreKeys:
metrics
.
keys
.
toList
());
});
}
static
Future
<
Map
<
String
,
dynamic
>>
_buildAot
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
'clean'
]);
final
Stopwatch
watch
=
new
Stopwatch
()..
start
();
final
Stopwatch
watch
=
new
Stopwatch
()..
start
();
final
String
buildLog
=
await
evalFlutter
(
'build'
,
options:
<
String
>[
final
String
buildLog
=
await
evalFlutter
(
'build'
,
options:
<
String
>[
'aot'
,
'aot'
,
'-v'
,
'-v'
,
'--profil
e'
,
'--releas
e'
,
'--no-pub'
,
'--no-pub'
,
'--target-platform'
,
'android-arm'
// Generate blobs instead of assembly.
'--target-platform'
,
'android-arm'
// Generate blobs instead of assembly.
]);
]);
watch
.
stop
();
watch
.
stop
();
final
RegExp
metricExpression
=
new
RegExp
(
r'([a-zA-Z]+)\(CodeSize\)\: (\d+)'
);
final
RegExp
metricExpression
=
new
RegExp
(
r'([a-zA-Z]+)\(CodeSize\)\: (\d+)'
);
final
Map
<
String
,
dynamic
>
metrics
=
new
Map
<
String
,
dynamic
>.
fromIterable
(
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>.
fromIterable
(
metricExpression
.
allMatches
(
buildLog
),
metricExpression
.
allMatches
(
buildLog
),
key:
(
Match
m
)
=>
_sdkNameToMetricName
(
m
.
group
(
1
)),
key:
(
Match
m
)
=>
_sdkNameToMetricName
(
m
.
group
(
1
)),
value:
(
Match
m
)
=>
int
.
parse
(
m
.
group
(
2
)),
value:
(
Match
m
)
=>
int
.
parse
(
m
.
group
(
2
)),
);
);
data
[
'aot_snapshot_build_millis'
]
=
watch
.
elapsedMilliseconds
;
metrics
[
'aot_snapshot_build_millis'
]
=
watch
.
elapsedMilliseconds
;
return
new
TaskResult
.
success
(
data
,
benchmarkScoreKeys:
data
.
keys
.
toList
());
return
metrics
;
});
}
static
Future
<
Map
<
String
,
dynamic
>>
_buildDebug
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
'clean'
]);
final
Stopwatch
watch
=
new
Stopwatch
();
if
(
deviceOperatingSystem
==
DeviceOperatingSystem
.
ios
)
{
await
prepareProvisioningCertificates
(
cwd
);
watch
.
start
();
await
flutter
(
'build'
,
options:
<
String
>[
'ios'
,
'--debug'
]);
watch
.
stop
();
}
else
{
watch
.
start
();
await
flutter
(
'build'
,
options:
<
String
>[
'apk'
,
'--debug'
]);
watch
.
stop
();
}
return
<
String
,
dynamic
>{
'debug_full_build_millis'
:
watch
.
elapsedMilliseconds
,
};
}
}
static
String
_sdkNameToMetricName
(
String
sdkName
)
{
static
String
_sdkNameToMetricName
(
String
sdkName
)
{
...
...
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