是否有可能/容易地确定一个程序正在使用多少功率? [英] Is it possible/easy to determine how much power a program is using?

查看:105
本文介绍了是否有可能/容易地确定一个程序正在使用多少功率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以确定甚至合理地估计程序正在使用多少电量?我的想法是根据功耗而不是典型的性能来分析我的代码.

Is it possible to determine or even reasonably estimate how much power a program is using? The idea being to profile my code in terms of power consumption instead of just typical performance.

是否足以衡量CPU使用率,GPU使用率和内存访问量?

Is it enough to measure CPU use, GPU use and memory access?

推荐答案

有很多方面会影响应用程序的功耗,并且这些方面会因所使用的硬件而有很大差异.

There are many aspects that can influence the power consumption of an application, and these will vary a lot depending on the used hardware.

获得想法的最简单方法是

The easiest way to get an idea is to measure it. If your program is doing heavy calculations, it is quite simple to measure the difference. Just read out the usage while the app is running, and subtract the usage while not.

如果您的应用程序不是繁重的计算类型,那么挑战就更大了,因为简单的1个时间点比较无法解决问题.您将获得一个可以随时间记录使用情况的测量设备,您需要将该记录与计算机记录的进程活动进行比较,并尝试过滤掉所有其他计划的任务(检查更新等).

If your app is not of the heavy calculations kind, then the challenge is allot bigger, since a simple 1 point in time comparison will not do the trick. You could get a measuring device that can log usage over time, which log you would need to compare with the logged process activity of your machine and try to filter all other scheduled tasks (checks for updates etc) out.

如果您想采用这种方法,这只是一个提示,APC的UPS内置了此功能,并且 PowerChute 软件将功耗日志存储在Access数据库中(C:\ Program Files \ APC \ PowerChute Personal Edition \ EnergyLog.mdb).我不确定这是否适用于所有型号,但这是我的一个很好的附加功能( Pro 550 ).我会将数据放在 Xperf跟踪(免费的内置探查器在Windows中,在此处查找概述),以便关联电源您的应用程序活动的变化,并过滤出计划的作业等...

Just a tip if you want to go this way, APC's UPS's come with this functionality built-in, and the PowerChute software stores a power consumption log in an Access Database (C:\Program Files\APC\PowerChute Personal Edition\EnergyLog.mdb). I'm not sure if this is true for all models, but it was a nice extra feature that came with mine (Pro 550). I would lay the data alongside an Xperf trace (the free built in profiler in Windows, look here for an overview), in order to correlate power variations with your applications activity, and filter out scheduled jobs etc...

也就是说,请记住,在不同的硬件上您将获得不同的结果. ssd与传统的硬盘有所不同,并且使用的grafix适配器也会有所不同,因此,通过在典型"系统上进行测量,您只能总体上获得大概的估计.台式机系统将比笔记本电脑等消耗更多的配额...(另请参见

That said, remember you will get different results on different hardware. An ssd will differ from a tradational harddisk, and the used grafix adapter can also make a difference, so you could only get a rough estimation overall, by measuring on a "typical" system. Desktop systems will consume allot more than laptops, etc... (also see this blogpost).

功耗分析工具在移动设备中更为常见.我不是该领域的专家,但我知道有很多工具.

Power consumption profiling tools are allot more common for mobile devices. I'm not an expert in that field, but I know there are quite some tools out there.

这篇关于是否有可能/容易地确定一个程序正在使用多少功率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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