What units can be used to benchmark CPU usage? Percentage seems unhelpful

223 Views Asked by At

I regularly see coder discussions here about CPU usage and questions about reducing 'high usage', covering everything from Javascript functions to compiled C executables.

I notice that almost always people are referring to the percentage of CPU being consumed - which naturally varies hugely according to where the code is running. eg. "When I run this I get 80% CPU usage, so I need to optimise my code".

Whilst it's clear that a level of 'high CPU usage' for looping code is often a good indicator that something is wrong, and code needs to sleep a little or be refactored, I am very surprised not to be able to find a common unit of processing measurement that is used to describe intense CPU usage rather than the percentage of the author's own machine's CPU, for example.

We can easily measure memory/disk usage by an algorithm on a certain platform, but is there any easily attainable and consistent useful figure for an amount of processing that could be used to compare usage?

Are FLOPS still used in the modern world, for instance?

0

There are 0 best solutions below