Performance and I/O
Performance arithmetic with every step: the CPU time and average CPI of two machines or two compilers (and why MIPS mislead), Amdahl’s law with the speed-up of each improvement and its limit, and how much CPU polling, interrupts and DMA take. It runs in your browser, on your phone too.
How to use it
- Choose CPU time, Amdahl’s law or I/O.
- Change the data in the table: instruction classes with their CPI and how many each program executes; the parts of the time and how many times each one speeds up; or the device, the clock and the cost of each poll, interrupt and DMA block. Or pick an example: the till closing, the 120 s benchmark or the 2000 MB/s SSD.
- Press Step to see the arithmetic one line at a time; below are the results with their bars.
What it works out
CPU time = instructions × CPI ÷ frequency; the average CPI weights each class by how many instructions it has. Amdahl: the speed-up is the time before divided by the time after, and what is not improved sets the limit 1 ÷ (1 − F).
For I/O, the % of CPU is the cycles per second each method spends divided by the clock’s cycles per second; above 100 %, the CPU cannot keep up. The arithmetic is that of topics 12 and 15 (3.40 s versus 2.60 s, Amdahl 1.25 and the SSD that would need 1250 % of the CPU by polling).
The rules it follows
- Instructions are entered in billions (×109) and the clock in GHz.
- Interrupts only cost when the device has data (the activity); polling asks all the time.
- DMA costs what the CPU spends setting it up and handling its interrupt at the end of each block.
For the exam
The exam asks for the CPU time or average CPI, which improvement gains most with Amdahl or the % of CPU of an I/O method. Do it on paper, without a calculator, and check it here; the challenge below gives you new numbers.
