高效的软件编码 [英] Power Efficient Software Coding
问题描述
我知道H / W深度睡眠模式,待机模式用于在较低周期或时钟周期内对硬件进行时钟整定,以节省电量,但是我正在寻找一些想法这个观点:
其中我的代码正在运行,它需要继续执行,给定这样我可以有效地编写代码power,以便消耗最小瓦数?
有没有任何特殊的编程结构,数据结构,控制结构,我应该看看,以实现给定功能的最低功耗。
是否有任何s / w高级设计考虑,在代码结构设计时应该牢记,或在低级设计时,尽可能使代码尽可能高效(最低功耗) ?
- 喜欢
1800信息
避免投票订阅事件并等待他们发生 - 仅在必要时更新窗口内容 - 让系统决定何时重绘
- 更新窗口内容时确保您的代码重新创建为尽可能少的无效区域
- 使用快速代码,CPU可以更快地返回深度睡眠模式,并且有更好的机会,这样的代码保留在L1缓存中
-
- 一次操作小数据,数据也保留在缓存中
- 确保您的应用程序在后台执行不必要的操作
- 使您的软件不仅功率高效,而且还具有电源感知 - 电池更新时更少的图形,禁用动画,减少硬盘抖动
并阅读其他准则。 ;)
最近,一系列的帖子叫做优化软件应用程序的权力,英特尔软件博客可能对x86开发人员有用。
In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code. I am aware of the H/W Deep sleep mode, Standby mode that are used to clock the hardware at lower Cycles or turn of the clock entirel to some unused circutis to save power, but i am looking for some ideas from that point of view:
Wherein my code is running and it needs to keep executing, given this how can I write the code "power" efficiently so as to consume minimum watts?
Are there any special programming constructs, data structures, control structures which i should look at to achieve minimum power consumption for a given functionality.
Are there any s/w high level design considerations which one should keep in mind at time of code structure design, or during low level design to make the code as power efficient(Least power consuming) as possible?
- Like
1800 INFORMATION
said, avoid polling; subscribe to events and wait for them to happen - Update window content only when necessary - let the system decide when to redraw it
- When updating window content, ensure your code recreates as little of the invalid region as possible
- With quick code the CPU goes back to deep sleep mode faster and there's a better chance that such code stays in L1 cache
- Operate on small data at one time so data stays in caches as well
- Ensure that your application doesn't do any unnecessary action when in background
- Make your software not only power efficient, but also power aware - update graphics less often when on battery, disable animations, less hard drive thrashing
And read some other guidelines. ;)
Recently a series of posts called "Optimizing Software Applications for Power", started appearing on Intel Software Blogs. May be of some use for x86 developers.
这篇关于高效的软件编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!