CPU usage question

Permabanned
Joined
18 Oct 2002
Posts
47,396
Location
Essex
This might be considered a hardware question but it is specifically related to behaviour within Windows XP so I hope the mods will leave it here.

If you perform a quick task in Windows which (according to Task Manager) takes less than 100% CPU usage to accomplish, does this mean that a more powerful CPU would not actually accomplish it any quicker? Your existing CPU has accomplished the task asked of it without needing to use all of its available CPU cycles, so a faster CPU would have no effect. Is that right? This is probably a silly question but I'm not entirely sure :)

The sort of tasks I mean are, for example, opening a window, navigating around a web page or forum (setting aside the network speed factors) - things that take little time to complete.
 
I tried a simple task, running my CPU at default clocks and opening 'My Computer' it uses around 16-20%. If I underclock by 50% it took 37-40% CPU. Theoretically even though the slower CPU is having to work 'twice as hard' if you will, it is still accomplishing it well within its capabilities and seemingly instantly in both cases. I appreciate it isn't *quite* that simple but I think the general principle is correct?

So in theory, a processor 2x the speed of mine would simply require around 8-10% CPU usage to do the same task.
 
Yes that's right. A task that uses say 20% CPU would only use 10% if the CPU was exactly double the speed.

But technically, no matter how irrelevant or indistinquishable the performance gain is to the user, the CPU that is double the speed would have also accomplished the task in half the time.

Obviously a task that didn't require 100% CPU in the first place aren't really thought of as being the main beneficiaries of a CPU upgrade - but it still helps them out regardless.

In IIS v6+ you can set limits on how much CPU time an application pool can use. Let's assume there is a heavy process that pins that pool at 20% for long periods of time. So if you had two servers, one with a CPU exactly double the speed... the server with the faster CPU would be processing that application pool at twice the speed.

Hmm - re your last paragraph, say you had one CPU at 1.5GHz and one at 3GHz (assume for the sake of argument, the 3GHz machine is exactly 2x the speed of the 1.5GHz machine) - to test the thesis you would need to give the 1.5GHz machine 40% and the 3.0GHz machine 20%. To my mind, the time taken to complete the task would be roughly the same. You are saying that the 3GHz machine would still complete it twice as fast? Are you sure about that?
 
Ah I see what you're saying. The reason I'm asking this, apart from finding it interesting for its own sake, is because I was wondering if a faster system than mine would be noticeably quicker for general Windows usage, stuff that doesn't take much CPU % now. I was doing some stuff I normally do, with task manager open, and noticed how it wasn't taxing the CPU very heavily. So what you're saying is that even with this being the case, a more powerful CPU would still be snappier than my existing one - cool :)

It would be interesting to see some benchmarks to prove this though - shame you can't limit CPU usage in Windows for any app of your choosing.
 
Right I did the tests. So doesn't this prove what I said was correct?

SuperPI, 1M test

P4 @ 3.0, limited to 25% CPU usage = 211 seconds
P4 @ 1.5, limited to 50% CPU usage = 202 seconds

Allowing for margin of error in the SuperPI test and the CPU limiting program etc. they took basically the same amount of time to complete.
 
why have you limited the cpu?
Have you read the thread?

a program if needed will use 100% cpu. The reason it doesn't show that in manager is because most processes don't need 100% of the cpu for more than a fraction of a second.
I know. This whole thread is about ascertaining how long it takes a CPU to carry out a task when it DOESN'T need to use all of its available performance to achieve it. Such as opening a window, or browsing a website or forum. Navigating around this forum causes CPU usage to pop up and down, but it goes nowhere near 100.

What you want to do is run super pi at 100% on the 3ghz and 1.5ghz and that shows you the speed difference.
But running at 100% wouldn't prove anything with regards to the thread question. It is obvious a 3 gig CPU at full load will be twice as fast as a 1.5 at full load. That isn't in question and running benchmarks to prove that is hardly necessary.
 
As I keep saying Task Manager's "percentages" aren't an exact science. They are only provided to give user friendly representation. As I said before, technically, which ever thread is executing of a processor has got 100% of its time... a processor can only do one thing at once. Therefore whichever thread is on it has its undivided attention. But that is at the nanosecond scale. On a human scale of seconds things are very different.

And this is what TM does... to calculate the CPU % for each process it asks the kernel's scheduler how much processor time it has given to the process so far and divides that by the computer's uptime multiplied by how many processors/cores the computer has.

It also complicates things by throwing the system idle process into the mix. This is a variable in the discussion that we don't need and doesn't actually add anything either. This is quite a technical subject and it helps to keep the number of variables down and the simplicity up to help people understand. Unfortunately it is also one of "those things" that generally people will either "get" or "not get" the first time around.
Thanks for taking the time to explain about this, in this thread - I have a much better understanding of it now.

Games are a very bad example because unlike most software they have very complicated timing algorithms which make them execute at a set speed regardless of how fast the processor is. This is why a DOS game from the 90's still plays fine on a modern PC and isn't running in ultra speed.
Not sure you're entirely right about DOS games there though? I remember running a few old DOS games - one of the very earliest Test Drive games springs to mind, I think - and it ran at insane speeds even on a Pentium 133 - totally unplayable. AFAIK a lot of old DOS games are like that. I can't swear they weren't pre-90s though, if that makes a difference.

In fact there are apps for modern machines, specifically designed to slow your machine down to make old DOS games playable, eg. Mo' Slo and CpuKiller.
 
Back
Top Bottom