Computer Architecture Basics and Performance
Introduction to Architecture
- Instruction Set Architecture (ISA): An assembly language programmer's view of the microprocessor.
- Assembler: Translates symbolic assembly language code into binary machine language code.
Computer Performance Metrics
- Execution Time (Response Time): Time to complete a program or task.
- Throughput (Bandwidth): Number of programs or tasks completed per time unit.
- Execution Time (texec, i.e., elapsed time, wall time, real time, response time): Elapsed seconds from start to finish. Includes:
- Executing instructions
- Disk access
- Memory access
- I/O activities
- OS overhead
- User CPU Time (tcpu(user)): Seconds the CPU spends executing the program's instructions.
- System CPU Time (tcpu(sys)): Seconds the CPU spends executing OS (kernel) instructions on behalf of the program.
- System Performance: Execution time on an unloaded single-tasking system. perfsys = 1 / texec. Includes OS overhead, so system performance is highly dependent on the efficiency of the OS.
- CPU Performance: The inverse of user CPU time. perfcpu(user) = 1 / tcpu(user). Excludes OS overhead, so CPU performance is highly dependent on the CPU organization. To increase CPU performance, user CPU time must decrease.
- Bottleneck: Something which restricts performance. The canonical computer system bottleneck is CPU to main memory access time.
- To maximize performance on program P on computer system X, minimize execution time of P on X: perfX(P) = 1 / texec,X(P)
- Relative Performance (n) of computer X compared to computer Y (on program P): perfrel,X(P),Y(P) = perfX(P) / perfY(P)
Time and Frequency Units
- Time Units (Period):
- Millisec (ms) = 10-3 sec
- Microsec (μs) = 10-6 sec
- Nanosec (ns) = 10-9 sec
- Picosec (ps) = 10-12 sec
- Frequency Units:
- Hertz (Hz) = 1
- Kilohertz (KHz) = 103
- Megahertz (MHz) = 106
- Gigahertz (GHz) = 109 times per second
System Clock and CPU Time
- System Clock: Device which generates the master clock signal. Coordinates activities of the system. Clock frequency (clock rate, tick rate) and clock period (clock cycle time, cycle time) are inversely related: fclock = 1 / pclock.
- Relationship between CPU performance (user CPU time) and system clock: tcpu(user) = prog clocks * pclock; tcpu(user) = prog clocks / fclock. To decrease user CPU time: decrease program clocks, and/or decrease clock period (increase clock frequency).
- Static Instruction Count (icountstat): Number of machine language instructions in the program.
- Dynamic Instruction Count (icountdyn): Number of machine language instructions that are executed.