Benchmark performance 30% speedup in mains over battery operation?

1

This observation arose as I was evaluating the running time efficiency of various implementations of a prime sieve algorithm.

The surprise was finding that differences between the best algorithms was much less than the 30% speedup achieved running the same algorithm (either one) just by switching from battery use to mains use.

Given that my power settings are not set to maximise battery life, I'd assumed that this would not be such a large consideration.

Any insight into to why this difference is so large?

Is it due to a software/OS induced throttling (in which case can I turn off the throttling behaviour when in battery mode?), or does the choice of power source directly affect the electrical characteristics of the chip?

(My machine: Windows XP, Intel Core2Duo, 2GHz, 2GB RAM)

PS: I'm aware that graphics card performance depends significantly on power source, e.g. discussed here, but since my benchmarking programs are console programs with no graphics and no print statements (they run in memory till 'done'), I'm not expecting the GPU to be involved... is that right?

Assad Ebrahim

Posted 2014-05-10T10:37:41.053

Reputation: 1 702

1Your power settings may not be set on the longer life option, but they might still have a 'max CPU % while on battery' set (I'm not sure if XP can do that, but Vista+ certainly can), so check all the advanced power options for your plan. Also, take a look at your BIOS options. – Bob – 2014-05-10T11:13:35.403

Answers

2

Your guess is right. Windows XP has CPU throttling built in to the OS and does not provide easy access to changing it. However, you can use the built-in command-line POWERCFG.EXE utility to change it - see a discussion at Technet here or a more complete explanation on Wikipedia here. There's a tutorial for it here.

In short, to get maximum CPU speed while on battery for a Power Scheme named "Portable/Laptop" use the command:

C:\Windows\System32\PowerCFG.exe /change "Portable/Laptop" /processor-throttle-dc none

To switch it back change "none" to "dynamic" (or whatever its previous setting was). You can check the power settings by using this command:

C:\Windows\System32\Powercfg /query

You can also see the actual speed you're getting in each situation by looking at My Computer --> Properties. Under the Computer section you'll see the name of your CPU and it's maximum frequency. Under that it will show the actual frequency it's running at. Check under both conditions (battery & plugged in) and you should see the difference. Then change it with POWERCFG and see the difference both there & in your benchmarks.

FYI, there is an alternate tool you can try instead of POWERCFG called SpeedswitchXP - I have no experience with it, but it's described here. According to the page it gives GUI access to the CPU throttling option.

yosh m

Posted 2014-05-10T10:37:41.053

Reputation: 2 048