← Back to Computer Science

Input, output, and system performance

Computers interact with the world through input and output devices, and their overall performance depends on how all components work together.

Input and output devices

Input devices send data to the computer: keyboards, mice, touchscreens, microphones, cameras, and sensors. Output devices present results: displays, speakers, printers, and actuators that control physical systems. Many devices, such as touchscreens and network cards, do both.

Buses and interfaces

Buses carry data between components. Modern computers use high-speed interfaces: PCI Express for graphics cards and SSDs, USB for peripherals, and Thunderbolt for fast external devices and displays. Wireless interfaces include Wi-Fi and Bluetooth.

Interrupts

When an input device needs attention, such as a key being pressed, it sends an interrupt signal to the CPU, which pauses its current work, handles the event, and resumes. Interrupts let computers respond quickly without constantly checking every device (polling).

Direct memory access

Direct memory access (DMA) lets devices, such as disks and network cards, transfer data to and from memory without the CPU handling every byte, freeing the CPU for other work. This is essential for fast storage and networking.

Measuring performance

Performance can be measured by response time (how long a task takes) or throughput (how many tasks per unit time). Benchmarks run standard workloads to compare systems. Amdahl's law shows that speeding up one part of a system has limited benefit if other parts are slow: the overall speedup is limited by the fraction of time the improved part is used.

Amdahl's law example

If 60% of a program's time can be parallelised perfectly across many cores, the remaining 40% still runs serially. Even with infinite cores, the maximum speedup is \(\frac{1}{0.4} = 2.5\) times. With 4 cores, the speedup is \(\frac{1}{0.4 + 0.6/4} \approx 1.82\).

Power and heat

Processors consume power and generate heat, which limits performance, especially in laptops and phones. Energy efficiency is now a key design goal; ARM-based chips are known for strong performance per watt. Data centres spend heavily on cooling and increasingly use renewable energy.

Worked example

A video editor complains that exporting videos is slow. Investigation shows the CPU is only 40% busy while the old hard drive is constantly at maximum. The bottleneck is storage, not the processor. Upgrading to an SSD speeds up exports far more than a faster CPU would, illustrating the importance of finding the true bottleneck.

Key takeaways

Input and output devices connect computers to the world. Buses and interfaces such as PCIe, USB, and Thunderbolt carry data. Interrupts let devices signal the CPU; DMA moves data without CPU involvement. Performance is measured by response time and throughput. Amdahl's law limits speedups from improving only part of a system. Power and heat constrain design. Finding the real bottleneck is key to improving performance.

Flashcard

Input device

Sends data to the computer

Keyboard, camera.

Check your understanding

According to Amdahl's law, if 50% of a program can be parallelised, what is the maximum speedup with unlimited cores?

Take the unit quiz

← Previous lesson Next lesson →