I'm working on a program that involves some computationally intensive algorithms. On my i7 it takes about ±45 seconds to perform one complete calculation.
It's not multithreaded yet, hence it only uses one core, so there's an obvious opportunity for improvement.
However, when I monitor my processor usage, I noticed it doesn't even fully use one core. With no other intensive processes running, I see activity on one of my 8 cores, but it's only doing 60-80%, whereas I would expect the core that runs my program to be fully hogged at 100%.
The algorithm involves no disk or network access, and there's no large amounts of memory involved (it does some very heavy image processing, I'm currently using very small images only) and it doesn't use the GPU. It's a simple, straightforward process, doing just one heavy calculation, and I'm not sleeping or interrupting or waiting for events or anything.
Any reason why a computationally intensive program (that doesn't rely on external resources whatsoever) would not be using the running core to it's full capacity?