Merge lp:~fboucault/ubuntu-clock-app/fix_startup_time into lp:ubuntu-clock-app

Proposed by Florian Boucault
Status: Merged
Approved by: Bartosz Kosiorek
Approved revision: 484
Merged at revision: 482
Proposed branch: lp:~fboucault/ubuntu-clock-app/fix_startup_time
Merge into: lp:ubuntu-clock-app
Diff against target: 243 lines (+43/-11)
9 files modified
app/MainPage.qml (+13/-10)
app/alarm/AlarmSettingsPage.qml (+3/-0)
app/alarm/AlarmSound.qml (+4/-0)
app/clock/ClockPage.qml (+12/-1)
app/components/ActionIcon.qml (+1/-0)
app/components/AnalogMode.qml (+7/-0)
app/components/EmptyState.qml (+1/-0)
app/components/ExpandableListItem.qml (+1/-0)
app/worldclock/AddWorldCityButton.qml (+1/-0)
To merge this branch: bzr merge lp:~fboucault/ubuntu-clock-app/fix_startup_time
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve
Bartosz Kosiorek Approve
Review via email: mp+301045@code.launchpad.net

Commit message

Improved startup time (1600ms saved on BQ E4.5):
- Load Images and Icons asynchronously
- Load bottom edge asynchronously
- Workaround PositionSource bug that was delaying startup by 1000ms

Description of the change

Improved startup time (1600ms saved on BQ E4.5):
- Load Images and Icons asynchronously
- Load bottom edge asynchronously
- Workaround PositionSource bug that was delaying startup by 1000ms

To post a comment you must log in.
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

Great improvement. Thanks.
I wish to decrease startup time for Contacts, Messages and Phone, which is took about 4 seconds.

review: Approve
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/MainPage.qml'
2--- app/MainPage.qml 2016-03-03 14:38:55 +0000
3+++ app/MainPage.qml 2016-07-25 09:05:25 +0000
4@@ -51,18 +51,21 @@
5 Timer {
6 id: hideBottomEdgeHintTimer
7 interval: 3000
8- onTriggered: bottomEdge.hint.status = BottomEdgeHint.Inactive
9+ onTriggered: bottomEdgeLoader.item.hint.status = BottomEdgeHint.Inactive
10 }
11
12- AlarmBottomEdge {
13- id: bottomEdge
14- objectName: "bottomEdge"
15- height: parent.height
16- pageStack: mainStack
17- alarmModel: _mainPage.alarmModel
18- hint.visible: bottomEdge.enabled && isClockPage
19- hint.objectName: "bottomEdgeHint"
20- Component.onCompleted: hideBottomEdgeHintTimer.start()
21+ Loader {
22+ id: bottomEdgeLoader
23+ asynchronous: true
24+ onLoaded: hideBottomEdgeHintTimer.start()
25+ Component.onCompleted: setSource("components/AlarmBottomEdge.qml", {
26+ "objectName": "bottomEdge",
27+ "parent": _mainPage,
28+ "pageStack": mainStack,
29+ "alarmModel": Qt.binding( function () { return _mainPage.alarmModel } ),
30+ "hint.visible": Qt.binding( function () { return _mainPage.isClockPage } ),
31+ "hint.objectName": "bottomEdgeHint"
32+ })
33 }
34
35 AlarmUtils {
36
37=== modified file 'app/alarm/AlarmSettingsPage.qml'
38--- app/alarm/AlarmSettingsPage.qml 2016-07-13 17:30:03 +0000
39+++ app/alarm/AlarmSettingsPage.qml 2016-07-25 09:05:25 +0000
40@@ -134,6 +134,7 @@
41 height: width
42 name: "tick"
43 visible: alarmSettings.duration === duration
44+ asynchronous: true
45 }
46 }
47
48@@ -164,6 +165,7 @@
49 height: width
50 name: "tick"
51 visible: alarmSettings.snoozeDuration === duration
52+ asynchronous: true
53 }
54 }
55
56@@ -213,6 +215,7 @@
57 width: units.gu(2)
58 height: width
59 name: "go-next"
60+ asynchronous: true
61 }
62 }
63
64
65=== modified file 'app/alarm/AlarmSound.qml'
66--- app/alarm/AlarmSound.qml 2016-07-13 16:56:39 +0000
67+++ app/alarm/AlarmSound.qml 2016-07-25 09:05:25 +0000
68@@ -294,6 +294,7 @@
69 name: "media-playback-pause"
70 visible: _customAlarmSoundDelegate.isChecked &&
71 previewAlarmSound.playbackState === Audio.PlayingState
72+ asynchronous: true
73 }
74
75 Icon {
76@@ -303,6 +304,7 @@
77 width: units.gu(2)
78 height: width
79 name: "tick"
80+ asynchronous: true
81 }
82 }
83
84@@ -376,6 +378,7 @@
85 name: "media-playback-pause"
86 visible: _alarmSoundDelegate.isChecked &&
87 previewAlarmSound.playbackState === Audio.PlayingState
88+ asynchronous: true
89 }
90
91 Icon {
92@@ -385,6 +388,7 @@
93 height: width
94 name: "tick"
95 anchors.verticalCenter: parent.verticalCenter
96+ asynchronous: true
97 }
98 }
99
100
101=== modified file 'app/clock/ClockPage.qml'
102--- app/clock/ClockPage.qml 2016-07-13 16:56:39 +0000
103+++ app/clock/ClockPage.qml 2016-07-25 09:05:25 +0000
104@@ -61,6 +61,16 @@
105 otherElementsStartUpAnimation.start()
106 }
107
108+ // FIXME: workaround necessary because PositionSource blocks for over 1000ms
109+ // when becoming active the first time. In order not to slowdown startup we
110+ // delay requesting the location until the clock app is loaded.
111+ //
112+ // Ref.: https://bugs.launchpad.net/platform-api/+bug/1606156
113+ Connections {
114+ target: otherElementsStartUpAnimation
115+ onStopped: geoposition.active = true
116+ }
117+
118 PositionSource {
119 id: geoposition
120
121@@ -71,7 +81,7 @@
122
123 readonly property real userLatitude: position.coordinate.latitude
124
125- active: true
126+ active: false
127 updateInterval: 1000
128
129 onSourceErrorChanged: {
130@@ -230,6 +240,7 @@
131 name: "location"
132 height: units.gu(2.2)
133 color: location.color
134+ asynchronous: true
135 }
136
137 Label {
138
139=== modified file 'app/components/ActionIcon.qml'
140--- app/components/ActionIcon.qml 2016-03-21 19:03:05 +0000
141+++ app/components/ActionIcon.qml 2016-07-25 09:05:25 +0000
142@@ -39,5 +39,6 @@
143 height: width
144 anchors.centerIn: parent
145 color: UbuntuColors.slate
146+ asynchronous: true
147 }
148 }
149
150=== modified file 'app/components/AnalogMode.qml'
151--- app/components/AnalogMode.qml 2016-02-25 22:16:54 +0000
152+++ app/components/AnalogMode.qml 2016-07-25 09:05:25 +0000
153@@ -46,6 +46,7 @@
154 anchors.verticalCenterOffset: showSeconds ? units.dp(2) : units.dp(1)
155
156 source: "../graphics/Hour_Hand_Shadow.png"
157+ asynchronous: true
158 fillMode: Image.PreserveAspectFit
159 // notLocalizedDateTimeString.split(":")[3] is hours
160 // notLocalizedDateTimeString.split(":")[4] is minutes
161@@ -64,6 +65,7 @@
162
163 smooth: true
164 source: "../graphics/Hour_Hand.png"
165+ asynchronous: true
166 fillMode: Image.PreserveAspectFit
167 // notLocalizedDateTimeString.split(":")[3] is hours
168 // notLocalizedDateTimeString.split(":")[4] is minutes
169@@ -81,6 +83,7 @@
170 anchors.verticalCenterOffset: showSeconds ? units.dp(2) : units.dp(1)
171
172 source: "../graphics/Minute_Hand_Shadow.png"
173+ asynchronous: true
174 fillMode: Image.PreserveAspectFit
175 // notLocalizedDateTimeString.split(":")[4] is minutes
176 // notLocalizedDateTimeString.split(":")[5] is seconds
177@@ -98,6 +101,7 @@
178
179 smooth: true
180 source: "../graphics/Minute_Hand.png"
181+ asynchronous: true
182 fillMode: Image.PreserveAspectFit
183 // notLocalizedDateTimeString.split(":")[4] is minutes
184 // notLocalizedDateTimeString.split(":")[5] is seconds
185@@ -116,6 +120,7 @@
186
187 visible: showSeconds
188 source: "../graphics/Second_Hand_Shadow.png"
189+ asynchronous: true
190 fillMode: Image.PreserveAspectFit
191 // notLocalizedDateTimeString.split(":")[5] is seconds
192 // We need to calculate degree number for rotation (0 degrees means no rotation).
193@@ -133,6 +138,7 @@
194 smooth: true
195 visible: showSeconds
196 source: "../graphics/Second_Hand.png"
197+ asynchronous: true
198 fillMode: Image.PreserveAspectFit
199 // notLocalizedDateTimeString.split(":")[5] is seconds
200 // We need to calculate degree number for rotation (0 degrees means no rotation).
201@@ -150,6 +156,7 @@
202
203 fillMode: Image.PreserveAspectFit
204 source: "../graphics/Knob.png"
205+ asynchronous: true
206 }
207
208 SequentialAnimation {
209
210=== modified file 'app/components/EmptyState.qml'
211--- app/components/EmptyState.qml 2016-03-21 19:03:05 +0000
212+++ app/components/EmptyState.qml 2016-07-25 09:05:25 +0000
213@@ -40,6 +40,7 @@
214 height: units.gu(10)
215 width: height
216 color: "#BBBBBB"
217+ asynchronous: true
218 }
219
220 Label {
221
222=== modified file 'app/components/ExpandableListItem.qml'
223--- app/components/ExpandableListItem.qml 2016-03-03 10:24:42 +0000
224+++ app/components/ExpandableListItem.qml 2016-07-25 09:05:25 +0000
225@@ -54,6 +54,7 @@
226 SlotsLayout.position: SlotsLayout.Trailing
227 name: "go-down"
228 rotation: expandableListItem.expansion.expanded ? 180 : 0
229+ asynchronous: true
230
231 Behavior on rotation {
232 UbuntuNumberAnimation {}
233
234=== modified file 'app/worldclock/AddWorldCityButton.qml'
235--- app/worldclock/AddWorldCityButton.qml 2016-03-21 19:03:05 +0000
236+++ app/worldclock/AddWorldCityButton.qml 2016-07-25 09:05:25 +0000
237@@ -52,6 +52,7 @@
238 name: "add"
239 height: units.gu(2)
240 width: height
241+ asynchronous: true
242 }
243 }
244

Subscribers

People subscribed via source and target branches