13.07.2015 Views

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

POWER OPTIMIZATION FOR MOBILE USAGES• Turning off, or significantly reducing file scanning or indexing activities.• Postponing possible activities until AC power is present.Performance/quality/battery life trade-offs may vary during a single session, whichmakes implementation more complex. An application may need to implement anoption page to enable the user to optimize settings for user’s needs (seeFigure 10-4).To be battery-power-aware, an application may use appropriate OS APIs. ForWindows XP, these include:• GetSystemPowerStatus — Retrieves system power information. This statusindicates whether the system is running on AC or DC (battery) power, whetherthe battery is currently charging, <strong>and</strong> how much battery life remains.• GetActivePwrScheme — Retrieves the active power scheme (current systempower scheme) index. An application can use this API to ensure that system isrunning best power scheme.Avoid Using Spin Loops.Spin loops are used to wait for short intervals of time or for synchronization. Themain advantage of a spin loop is immediate response time. Using the PeekMessage()in Windows API has the same advantage for immediate response (but is rarelyneeded in current multitasking operating systems).However, spin loops <strong>and</strong> PeekMessage() in message loops require the constant attentionof the processor, preventing it from entering lower power states. Use them sparingly<strong>and</strong> replace them with the appropriate API when possible. For example:• When an application needs to wait for more then a few milliseconds, it shouldavoid using spin loops <strong>and</strong> use the Windows synchronization APIs, such asWaitForSingleObject().• When an immediate response is not necessary, an application should avoid usingPeekMessage(). Use WaitMessage() to suspend the thread until a message is inthe queue.Intel ® Mobile Platform Software Development Kit 5 provides a rich set of APIs formobile software to manage <strong>and</strong> optimize power consumption of mobile processor<strong>and</strong> other components in the platform.10.4.2 Reducing Amount of WorkWhen a processor is in the C0 state, the amount of energy a processor consumesfrom the battery is proportional to the amount of time the processor executes anactive workload. The most obvious technique to conserve power is to reduce thenumber of cycles it takes to complete a workload (usually that equates to reducingthe number of instructions that the processor needs to execute, or optimizing applicationperformance).5. Evaluation copy may be downloaded at http://www.intel.com/cd/software/products/asmona/eng/219691.htm10-6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!