tags:

views:

48

answers:

3

Hi.

I have a basic question. If I run an executable file (Release, Visual Studio 2010) on two computers with the same CPU speed run two different Windows operating systems, eg. Windws7 vs XP, shall I expect to see different CPU usages when I measure it using the task manager? Is the CPU speed the only factor to measuring the CPU usage?

Thanks.

Sar

+1  A: 

Different OS's? Yes.

Operating Systems are the go-between between the programs you run and the bare-metal they run on. As OS'es change and evolve the naturally and and remove features that consume resources--these are things that run in the background; or they could be changes to the manner in which the OS speaks to the hardware.

Also, the measurement of CPU usage is done by the OS. There isn't a tachometer on chips saying "running at 87% of redline", but rather that "tach" is constructed largely by the OS.


After better understanding your situation: I would suggest taking a look at the Performance Monitor (perfmon.exe) which ships with both XP and Win7, and gets you much finer-grain detail about processor usage levels. Another (very good) option would be to consider running a profiler on your application on both OSes and compare the results. It would likely be the best option to specifically benchmark your application on both OSes.

STW
Great! I will do a better performane measurement as you recommended.
Sar
+1  A: 

Even on the same OS you should expect to see different usages, because there are so many factors that determine CPU usage.

SamStephens
Hi. Thanks Sam.To measure the CPU usage for this particular executable, I make sure no user program is running. I get the same CPU usage everytime. My PC is running XP OS. My assignment is to reasearch to find out whether we will get a better usage if we switch to Windows 7.
Sar
A: 

The percentage of CPU usage listed in the task manager is not a very good indication of much of anything, except to say that a program either is, or is not using CPU. That particular statistic is derived from task switching statistics, and task switching is very sensitive to basically every single thing that's going on in a computer, from network access to memory speed to CPU temperature.

TokenMacGuy