Calculate CPU time from instruction count, cycles per instruction and clock speed, or find the clock rate needed or a processor’s instruction throughput.

Compare the same instruction workload


Related Calculators

Calculator Functions

FunctionWhat it doesWhat it requires
CPU execution timeFinds how long a processor takes to run a given number of instructionsRequires the instruction count, the average cycles per instruction and the clock rate
Instruction throughputFinds how many instructions per second a set of identical cores completesRequires the clock rate, the measured instructions per cycle, the number of active cores and their average utilization
Required clock rateFinds the clock rate needed to finish a workload within a target timeRequires the instruction count, the average cycles per instruction and the target CPU time

Clock rates are entered in GHz or MHz and instruction counts in single instructions, millions or billions. The execution time and throughput functions accept a comparison clock rate and cycles per instruction, which add a second processor’s figures for the same workload. The throughput function also accepts a parallel fraction, which adds an Amdahl speedup.

Processor Speed Formulas

T = I ร— CPI รท f [1]
TCPU execution time (s)
INumber of instructions executed
CPIAverage clock cycles per instruction
fClock rate (Hz)

A program needs I ร— CPI clock cycles, and each cycle lasts 1 รท f seconds [1]. Clock rate is therefore only one of three terms. The instruction count depends on the compiler and the instruction set, and the cycles per instruction depend on the instructions used and on the processor design [1].

CPU execution time

One billion instructions at 1.5 cycles per instruction on a 3 GHz processor take 1,000,000,000 ร— 1.5 รท 3,000,000,000 = 0.5 s. The result also lists the total clock cycles, the clock period and the effective rate in millions of instructions per second, 2,000 MIPS here.

Instruction throughput

IPS = f ร— IPC ร— N ร— U รท 100

IPC is the measured instructions per cycle, the inverse of CPI, N is the number of identical active cores and U is their average utilization in percent. A 3 GHz processor at 2 instructions per cycle completes 6 billion instructions per second on one busy core. Four cores at 75% utilization complete 3 ร— 2 ร— 4 ร— 0.75 = 18 billion instructions per second, shown as 18 GIPS. This assumes each core does independent work.

Speedup =
1 รท ((1 โˆ’ p) + p รท N) [2]

When a parallel fraction p is entered, the result adds this Amdahl speedup for one fixed workload, where p is the share of the single-core run time that can be spread across N cores [2]. With 90% parallel work and four cores it is 1 รท (0.1 + 0.9 รท 4) = 3.08 times, and it can never exceed 1 รท (1 โˆ’ p), 10 times here [2]. The speedup is reported separately and is not multiplied into the throughput.

Required clock rate

f = I ร— CPI รท T

This is the main formula solved for the clock rate. Running one billion instructions at 1.5 cycles per instruction in 0.25 s needs 1,000,000,000 ร— 1.5 รท 0.25 = 6,000,000,000 Hz, or 6 GHz.

Limits of This Estimate

  • Clock rate alone is not a measure of performance. Two processors at the same clock rate can differ widely in cycles per instruction, and the same program can compile to different instruction counts.
  • Cycles per instruction and instructions per cycle are measured for one workload on one processor. Memory stalls, shared caches and changes in clock rate under load alter them.
  • CPU execution time leaves out time spent waiting for input, output or other programs.
  • The Amdahl speedup is an upper bound that ignores the overhead of coordinating cores.

Sources