2

I'm writing a C++ application using Visual Studio 2013. The application iterates through an image doing some complicated analysis. The analysis is not particularly slow, but in order to test code efficiency I am running the analysis (say) 100 times and seeing how long it takes. Then I modify the code, re-run the test and see if there is an improvement (or degradation) in performance.

Problem is that while I have a powerful 4-core i5 (i5-4200U @ 1.6 GHz to be specific) and plenty of RAM, the overall CPU utilisation never exceeds about 30%. My process never seems to get beyond about 29.5%. I've tried setting the priority class of my application to "High" and this doesn't help. There is zero disk and network access, all in memory (and about 5GB of memory to spare).

Is this some secret Windows 8.1 setting to limit how much CPU a process can take (in order to preserve performance)? Can I change this programmatically or through some Control Panel applet (maybe set a higher CPU usage limit)?

1 Answer 1

4

Your application is most likely single-threaded. So it can use only one CPU core.
Since you have 4 CPU cores it is using 1/4 of CPU, which means roughly 25%.

In order to use your CPU to 100% you will need to modify your application to use multithreading (if possible). Not all problems can be solved in multi-threaded fashion. So it depends on what you are actually doing.

1
  • 1
    Yes, think you're right. Previous versions of Windows would tend to max out one core (the other cores would chug along at close to 0%). Seems like Windows 8.1 is doing a decent job of spreading the work of a single-thread across the available cores.
    – AlainD
    Commented Mar 8, 2015 at 18:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .