Closed
Bug 947617
Opened 12 years ago
Closed 12 years ago
Clock app consuming too much power
Categories
(Firefox OS Graveyard :: Gaia::Clock, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
1.4 S2 (28feb)
People
(Reporter: huseby, Assigned: jhylands)
Details
(Keywords: perf, power, Whiteboard: [c=power p=2 s= u=])
Attachments
(9 files)
Using a yoctopuce ammeter and mozilla battery harnesses for the nexus s and hamachi devices, I measured the launch and idle power consumption of the clock app. It appears that there is ample opportunity to optimize the app for lower power consumption.
For the launch test, I started the ammeter, touched the clock icon to launch it and then stopped the ammeter after 10 seconds. I then killed the clock app and repeated the test.
For the idle test, I started the clock app, let it run for 5 seconds, then ran the ammeter for 30 seconds. I then killed the clock app and repeated.
I did this on a Nexus S running FxOS 1.3, a Nexus S running Android 2.3.4, and a Hamachi running FxOS 1.3.
The raw data is attached to this bug. Here are the mean values for each test:
App Launch:
FxOS Nexus S: 228 mA
Android Nexus S: 198 mA
FxOS Hamachi: 143 mA
App Idle:
FxOS Nexus S: 175 mA
Android Nexus S: 147 mA
FxOS Hamachi: 128 mA
This might be a little hardware dependent in that the Nexus S's clock hardware just consumes more data. But if you compare the FxOS and Android numbers on the Nexus S, we should at least be 5%. For the app launch, we're 15% more, and for the idle, we're 19% more.
| Reporter | ||
Comment 1•12 years ago
|
||
screen shot of FxOS nexus s 30 second data run.
| Reporter | ||
Comment 2•12 years ago
|
||
screen shot of android nexus s 30 seconds data run.
| Reporter | ||
Comment 3•12 years ago
|
||
screen shot of fxos hamachi 30 second data run.
| Reporter | ||
Comment 4•12 years ago
|
||
the raw data measured during the FxOS Nexus S tests.
| Reporter | ||
Comment 5•12 years ago
|
||
raw data measured during the Android Nexus S tests.
| Reporter | ||
Comment 6•12 years ago
|
||
raw data measured during FxOS Hamachi tests
| Assignee | ||
Comment 7•12 years ago
|
||
Although we don't have the ammeter data integrated into the profiler UI yet, it is possible to do manual correlation of the data.
As expected, there is a fairly big jump in both CPU and power usage for ~50ms every second, but there is another jump in both about 300-400 ms before each second count, and the same code is being called from an actual Timer tick (nsDisplayList::PaitRoot takes most of the time in each case).
Since the actual clock GUI is only updating once per second, we should be able to almost cut the extra power usage in half by eliminating this second refresh. Turning on the "Flash repainted area" option, its pretty clear that the clock face is updating twice a second, even though it is only changing once. Perhaps it is redrawing the entire clock face without the second hand, and then redrawing again with the second hand in the new spot.
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → jhylands
Updated•12 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 8•12 years ago
|
||
This shows the ammeter readings, before the fix.
| Assignee | ||
Comment 9•12 years ago
|
||
This shows the ammeter readings, after the fix was applied.
| Assignee | ||
Comment 10•12 years ago
|
||
See before & after pic attachments for power impact
Attachment #8378442 -
Flags: review?(m)
| Assignee | ||
Updated•12 years ago
|
Whiteboard: [c=power p=1 s= u=] → [c=power p=2 s= u=]
Comment 11•12 years ago
|
||
Comment on attachment 8378442 [details]
Pull Request for fix
Thanks! This looks good, but could you explain what the translateZ(1px) does, and why it addresses the problem? In the past I've seen translateZ(0) used to trick browsers into GPU rendering; is that what's going on here or is this something different?
Ideally it'd be good to have a comment in the CSS to explain why, otherwise r+ from me.
Attachment #8378442 -
Flags: review?(m) → review+
| Assignee | ||
Comment 12•12 years ago
|
||
Yes, this invokes the GPU, and thus cuts way down on both CPU and power usage. The GPU is apparently much smarter about drawing stuff multiple times (which was happening before), so it ends up doing much less work.
Comment 13•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 14•12 years ago
|
||
Reverted due to an unexpected unit test failure; landing again momentarily after Travis passes.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 15•12 years ago
|
||
And we're back, landed in master:
https://github.com/mozilla-b2g/gaia/commit/bad5658f1c678191e21984d3217a4ad2bfad3c94
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Target Milestone: --- → 1.4 S2 (28feb)
You need to log in
before you can comment on or make changes to this bug.
Description
•