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
05866a27
Commit
05866a27
authored
Dec 12, 2016
by
John McCutchan
Committed by
GitHub
Dec 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fine grained hot reload benchmark timers (#7237)
parent
bf25b31a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
hot.dart
packages/flutter_tools/lib/src/hot.dart
+30
-0
No files found.
packages/flutter_tools/lib/src/hot.dart
View file @
05866a27
...
...
@@ -447,7 +447,22 @@ class HotRunner extends ResidentRunner {
final
bool
shouldReportReloadTime
=
!
_runningFromSnapshot
;
Stopwatch
reloadTimer
=
new
Stopwatch
();
reloadTimer
.
start
();
Stopwatch
devFSTimer
;
Stopwatch
vmReloadTimer
;
Stopwatch
reassembleTimer
;
if
(
benchmarkMode
)
{
devFSTimer
=
new
Stopwatch
();
devFSTimer
.
start
();
vmReloadTimer
=
new
Stopwatch
();
reassembleTimer
=
new
Stopwatch
();
}
bool
updatedDevFS
=
await
_updateDevFS
();
if
(
benchmarkMode
)
{
devFSTimer
.
stop
();
// Record time it took to synchronize to DevFS.
benchmarkData
[
'hotReloadDevFSSyncMilliseconds'
]
=
devFSTimer
.
elapsed
.
inMilliseconds
;
}
if
(!
updatedDevFS
)
return
new
OperationResult
(
1
,
'Dart Source Error'
);
String
reloadMessage
;
...
...
@@ -457,6 +472,8 @@ class HotRunner extends ResidentRunner {
_devFS
.
baseUri
.
resolve
(
entryPath
).
toFilePath
();
String
devicePackagesPath
=
_devFS
.
baseUri
.
resolve
(
'.packages'
).
toFilePath
();
if
(
benchmarkMode
)
vmReloadTimer
.
start
();
Map
<
String
,
dynamic
>
reloadReport
=
await
currentView
.
uiIsolate
.
reloadSources
(
pause:
pause
,
...
...
@@ -486,6 +503,14 @@ class HotRunner extends ResidentRunner {
printError
(
'Hot reload failed:
\n
code =
$errorCode
\n
message =
$errorMessage
\n
$st
'
);
return
new
OperationResult
(
errorCode
,
errorMessage
);
}
if
(
benchmarkMode
)
{
// Record time it took for the VM to reload the sources.
vmReloadTimer
.
stop
();
benchmarkData
[
'hotReloadVMReloadMilliseconds'
]
=
vmReloadTimer
.
elapsed
.
inMilliseconds
;
}
if
(
benchmarkMode
)
reassembleTimer
.
start
();
// Reload the isolate.
await
currentView
.
uiIsolate
.
reload
();
// We are now running from source.
...
...
@@ -516,6 +541,11 @@ class HotRunner extends ResidentRunner {
'
${getElapsedAsMilliseconds(reloadTimer.elapsed)}
.'
);
if
(
benchmarkMode
)
{
// Record time it took for Flutter to reassemble the application.
reassembleTimer
.
stop
();
benchmarkData
[
'hotReloadFlutterReassembleMilliseconds'
]
=
reassembleTimer
.
elapsed
.
inMilliseconds
;
// Record complete time it took for the reload.
benchmarkData
[
'hotReloadMillisecondsToFrame'
]
=
reloadTimer
.
elapsed
.
inMilliseconds
;
}
...
...
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