Mobile/Powersaving: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 5: Line 5:
== Metrics ==
== Metrics ==


* N900 - use [http://www.mauve.plus.com/bat.tar.gz this useful tool], run ././bq27220.sh -r
* # of wakeups/second, that prevent the CPU from sleeping. See [http://www.lesswatts.org/projects/powertop/ powertop]. Relevant in low CPU load. See [[Mobile/Powersaving/Wakeups]]
* # of wakeups/second, that prevent the CPU from sleeping. See [http://www.lesswatts.org/projects/powertop/ powertop]. Relevant in low CPU load. See [[Mobile/Powersaving/Wakeups]]
* CPU %. Relevant in high CPU load.
* CPU %. Relevant in high CPU load.

Revision as of 23:18, 17 June 2010

Overview

On mobile devices we want to use the least amount of power, so the device's battery will last as long as possible. Users will likely notice what browsers are better in this and prefer them.

Metrics

Ideas

OS-level process control

The 'nuclear option': Use OS-level operations to make processes sleep or use low CPU % when they should. On Linux this can be done with SIG_STOP, SIG_CONT (see e.g. cpulimit).

Tracked in bug 568054

Uses:

  • Put background tabs to sleep (requires one process per tab).
  • Force plugins to use low CPU % (Flash etc.)
  • Suspend top tab (or all tabs) when panning, or during other certain types of activity.
  • Throttle all tabs when battery is low (kind of like laptops dim their monitors on low battery).
    • User-controllable speed setting, to save power by throttling?
  • Put all tabs to sleep when idle (sort of like a screensaver). Although the mobile OS might already do this to us when it decides the device is idle.

Availability: Probably Meego. Android lacks it in the Java API (but other signals are present, so perhaps it will be added), perhaps using the NDK it is possible though?

Benefits: Straightforward, simple to implement, guarantees the best results.

Status: Working proof of concept on desktop and on N900 for suspending and/or throttling the content process as desired.

Firefox-level control

A more messy option: Add separate options throughout our codebase to allow things to be temporarily frozen - JavaScript, animations, plugins, etc. etc.

Tests

Bugs

  • bug 446418 + dependencies - Investigate power management issues
  • bug 567339 - Excessive wake-ups after visiting start page