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
4bec9cd9
Commit
4bec9cd9
authored
Jan 24, 2017
by
Yegor
Committed by
GitHub
Jan 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update build benchmark to match #7589 (#7600)
parent
a6777b2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
22 deletions
+35
-22
utils.dart
dev/devicelab/lib/framework/utils.dart
+8
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+26
-22
build_aot.dart
packages/flutter_tools/lib/src/commands/build_aot.dart
+1
-0
No files found.
dev/devicelab/lib/framework/utils.dart
View file @
4bec9cd9
...
@@ -237,6 +237,14 @@ Future<int> flutter(String command,
...
@@ -237,6 +237,14 @@ Future<int> flutter(String command,
canFail:
canFail
,
env:
env
);
canFail:
canFail
,
env:
env
);
}
}
/// Runs a `flutter` command and returns the standard output as a string.
Future
<
String
>
evalFlutter
(
String
command
,
{
List
<
String
>
options:
const
<
String
>[],
bool
canFail:
false
,
Map
<
String
,
String
>
env
})
{
List
<
String
>
args
=
<
String
>[
command
]..
addAll
(
options
);
return
eval
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
args
,
canFail:
canFail
,
env:
env
);
}
String
get
dartBin
=>
String
get
dartBin
=>
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
'dart'
);
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
'dart'
);
...
...
dev/devicelab/lib/tasks/perf_tests.dart
View file @
4bec9cd9
...
@@ -164,38 +164,42 @@ class BuildTest {
...
@@ -164,38 +164,42 @@ class BuildTest {
await
flutter
(
'packages'
,
options:
<
String
>[
'get'
]);
await
flutter
(
'packages'
,
options:
<
String
>[
'get'
]);
Stopwatch
watch
=
new
Stopwatch
()..
start
();
Stopwatch
watch
=
new
Stopwatch
()..
start
();
await
f
lutter
(
'build'
,
options:
<
String
>[
String
buildLog
=
await
evalF
lutter
(
'build'
,
options:
<
String
>[
'aot'
,
'aot'
,
'-v'
,
'--profile'
,
'--profile'
,
'--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
();
int
vmisolateSize
=
file
(
"
$testDirectory
/build/aot/snapshot_aot_vmisolate"
).
lengthSync
();
RegExp
metricExpression
=
new
RegExp
(
r'([a-zA-Z]+)\(CodeSize\)\: (\d+)'
);
int
isolateSize
=
file
(
"
$testDirectory
/build/aot/snapshot_aot_isolate"
).
lengthSync
();
int
instructionsSize
=
file
(
"
$testDirectory
/build/aot/snapshot_aot_instr"
).
lengthSync
();
int
rodataSize
=
file
(
"
$testDirectory
/build/aot/snapshot_aot_rodata"
).
lengthSync
();
int
totalSize
=
vmisolateSize
+
isolateSize
+
instructionsSize
+
rodataSize
;
Map
<
String
,
dynamic
>
data
=
<
String
,
dynamic
>{
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>.
fromIterable
(
'aot_snapshot_build_millis'
:
watch
.
elapsedMilliseconds
,
metricExpression
.
allMatches
(
buildLog
),
'aot_snapshot_size_vmisolate'
:
vmisolateSize
,
key:
(
Match
m
)
=>
_sdkNameToMetricName
(
m
.
group
(
1
)),
'aot_snapshot_size_isolate'
:
isolateSize
,
value:
(
Match
m
)
=>
int
.
parse
(
m
.
group
(
2
)),
'aot_snapshot_size_instructions'
:
instructionsSize
,
);
'aot_snapshot_size_rodata'
:
rodataSize
,
data
[
'aot_snapshot_build_millis'
]
=
watch
.
elapsedMilliseconds
;
'aot_snapshot_size_total'
:
totalSize
,
};
return
new
TaskResult
.
success
(
data
,
benchmarkScoreKeys:
data
.
keys
.
toList
());
return
new
TaskResult
.
success
(
data
,
benchmarkScoreKeys:
<
String
>[
'aot_snapshot_build_millis'
,
'aot_snapshot_size_vmisolate'
,
'aot_snapshot_size_isolate'
,
'aot_snapshot_size_instructions'
,
'aot_snapshot_size_rodata'
,
'aot_snapshot_size_total'
,
]);
});
});
}
}
static
String
_sdkNameToMetricName
(
String
sdkName
)
{
const
Map
<
String
,
String
>
kSdkNameToMetricNameMapping
=
const
<
String
,
String
>
{
'VMIsolate'
:
'aot_snapshot_size_vmisolate'
,
'Isolate'
:
'aot_snapshot_size_isolate'
,
'ReadOnlyData'
:
'aot_snapshot_size_rodata'
,
'Instructions'
:
'aot_snapshot_size_instructions'
,
'Total'
:
'aot_snapshot_size_total'
,
};
if
(!
kSdkNameToMetricNameMapping
.
containsKey
(
sdkName
))
throw
'Unrecognized SDK snapshot metric name:
$sdkName
'
;
return
kSdkNameToMetricNameMapping
[
sdkName
];
}
}
}
/// Measure application memory usage.
/// Measure application memory usage.
...
...
packages/flutter_tools/lib/src/commands/build_aot.dart
View file @
4bec9cd9
...
@@ -215,6 +215,7 @@ Future<String> _buildAotSnapshot(
...
@@ -215,6 +215,7 @@ Future<String> _buildAotSnapshot(
'--url_mapping=dart:ui,
$uiPath
'
,
'--url_mapping=dart:ui,
$uiPath
'
,
'--url_mapping=dart:jni,
$jniPath
'
,
'--url_mapping=dart:jni,
$jniPath
'
,
'--url_mapping=dart:vmservice_sky,
$vmServicePath
'
,
'--url_mapping=dart:vmservice_sky,
$vmServicePath
'
,
'--print_snapshot_sizes'
,
];
];
if
(!
interpreter
)
{
if
(!
interpreter
)
{
...
...
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