高能效软件编码 [英] Power Efficient Software Coding

查看:15
本文介绍了高能效软件编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在典型的手持/便携式嵌入式系统设备中,电池寿命是硬件、软件和设备可以支持的功能设计中的主要考虑因素.从软件编程的角度来看,人们知道 MIPS、内存(数据和程序)优化代码.我知道 H/W 深度睡眠模式、待机模式,它们用于以较低的周期为硬件提供时钟,或者将时钟完全转到一些未使用的电路以节省电力,但我正在从这个角度寻找一些想法:

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:

我的代码在哪里运行并且需要继续执行,鉴于此,我如何才能有效地编写代码power"以消耗最少的功率?

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?

推荐答案

  • 1800 INFORMATION所说,避免轮询;订阅事件并等待它们发生
  • 仅在必要时更新窗口内容 - 让系统决定何时重绘它
  • 更新窗口内容时,确保您的代码尽可能少地重新创建无效区域
  • 使用快速代码,CPU 可以更快地返回深度睡眠模式,并且此类代码更有可能保留在 L1 缓存中
  • 一次性处理小数据,以便数据也保留在缓存中
  • 确保您的应用在后台不会执行任何不必要的操作
  • 让您的软件不仅节能,而且具有节能意识 - 在使用电池时减少更新图形、禁用动画、减少硬盘抖动
    • 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
    • 并阅读其他一些指南.;)

      最近一系列帖子叫"Optimizing Software Applications for Power",开始出现在英特尔软件博客上.可能对 x86 开发人员有用.

      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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆