성능 평가 지표
- Response time: task을 처리하는데 걸리는 시간
- Throughput: 주어진 시간 동안 처리할 수 있는 task의 양
- 단위 예시) tasks, transactions, … / per hour
성능(performance) = 1/실행 시간(execution time)
성능x/성능y = 실행시간y/실행시간x = n
Execution Time
경과 시간(elapsed time = wall clock time = response time): 결과를 내놓는데 걸리는 총 시간으로 다음 시간의 합으로 구한다.
- processing
- I/O
- OS overhead
- idle time
CPU Time
- 주어진 job을 처리하는데 걸리는 순수한 시간 (I/O, idle time 등 제외)
- CPU time: user CPU time, system CPU time
- CPU나 시스템 성능에 영향을 받음
CPU Clocking
Cpu clock: 매 clock period마다 digital operation을 처리한다. 그리고 state를 flip flop에 저장한다.
Clock period: 한 clock cycle의 지속 시간, ps(피코)나 ns(나노)로 표현
Clock frequency: 초당 사이클 개수, cycle period에 반비례, 주로 GHz(기가헤르츠)로 표현
과학/공학자라면 알아야 할 단위
큰 단위
10^3:K(kilo)
10^6:M(mega)
10^9:G(giga)
10^12:T(tera)
10^15:P(peta)
작은 단위
10^-3: milli
10^-6: micro
10^-9: nano
10^-12: pico
CPU Time
CPU Time = CPU Clock Cycles * Clock Cycle Time = CPU Clock Cycles / Clock Rate
성능 개선 방법
- clock cycles 개수를 줄인다
- clock rate를 높인다
Clock Cycles
Clock Cycles = Instruction Count(개수) * Cycles per Instruction(CPI)
결론
CPU Time = Instruction Count CPI Clock Cycle time = Instruction Count * CPI / Clock Rate
- Instruction Count: ISA, compiler에 따라 변한다.
- CPI: cpu 하드웨어, instruction 조합에 따라 달라짐
성능에 영향을 미치는 요인
- 알고리즘(algorithm): 명령어 개수(instruction count)에 영향을 준다.
- 프로그래밍 언어(programming language): instrution count, cpi에 영향을 준다
- 컴파일러(compiler) : IC, CPI에 영향을 준다
- ISA(Instruction Set Architecture): instruction count, cpi(clocks per instruction), clock cycle time에 영향을 준다.
대