Can we optimize code to reduce power consumption?

2020-06-01 07:56发布

Are there any techniques to optimize code in order to ensure lesser power consumption.Architecture is ARM.language is C

9条回答
聊天终结者
2楼-- · 2020-06-01 08:21

If the processor is tuned to use less power when it needs less cycles, then simply making your code run more efficiently is the solution. Else, there's not much you can do unless the operating system exposes some sort of power management functionality.

查看更多
狗以群分
3楼-- · 2020-06-01 08:22

Try to stay in on chip memory (cache) for idle loops, keep I/O to a minimum, keep bit flipping to a minimum on busses. NV memory like proms and flash consume more power to store zeros than ones (which is why they erase to ones, it is actually a zero but the transitor(s) invert the bit before you see it, zeros stored as ones, ones stored as zeros, this is also why they degrade to ones when they fail), I dont know about volatile memories, dram uses half as many transistors as sram, but has to be refreshed.

For all of this to matter though you need to start with a lower power system as the above may not be noticeable. dont use anything from intel for example.

查看更多
ゆ 、 Hurt°
4楼-- · 2020-06-01 08:24

Keep IO to a minimum.

查看更多
登录 后发表回答