A Simple Command Line CPU Benchmark

I use a lot of virtual machines from a number of providers. They usually list them as 1 vCPU which doesn’t give much indication of how much processing power that single core is giving you.

There are lots of fully-featured benchmarking utilities that you could install to get a very details insight of how your CPU performs.

Ain’t nobody got time for that.

Instead, I use the following dead simple single core benchmark. It times how long the system takes to sha312sum 10GB of zeros:

dd if=/dev/zero bs=1MB count=10240 | sha512sum

On my local laptop this gives the result:

10240000000 bytes (10 GB, 9.5 GiB) copied, 17.7661 s, 576 MB/s

Whilst on the VM that’s running this website gives:

10240000000 bytes (10 GB, 9.5 GiB) copied, 48.3234 s, 212 MB/s

You can either look at the time or the throughput as your benchmar number as they are both related.