[Computer architecture] 1.6 Perfomance

준치·2022년 1월 21일
0

[Computer architecture]

목록 보기
5/18

Defining Performance

  • 어떤 기능에 중점을 두는지에 따라 performance의 순위가 바뀐다.

중요한 용어

  • Response time (execution time) : task를 수행하는데 걸리는 시간
  • Throughput (bandwidth) : 단위 시간당 처리하는 일의 양
    = 새로운 출력이 나갈수 있는 비율 (출력후 다음 출력까지의 속도)

Throughput and Response Time

  • 프로세서를 교체할 경우 response time이 줄어들고 이에 따라 throughput이 커진다. (throughput은 클수록 response time은 작을수록 성능이 좋다)
  • 프로세서를 추가할 경우 throughput만 커진다.
    - response time 향상 -> throughtput 향상 (항상 성립)
    - throughput 향상 -> response time 향상 (조건적 성립, 처리 요구가 throughput보다 많아 대기열이 걸릴 경우는 프로세서를 늘리는것이 response time을 향상시킨다.)

performance를 나타내는 관계

Performance=1Execution timePerformance = {1\over Execution\ time}
  • performance를 향상시킨다 = performance를 증가시킨다.
  • execution time을 향상시킨다 = execution time을 줄인다.


  • X가 Y보다 n배 빠르다.
    PerformanceXPerformanceY=n{Performance_X \over Performance_Y} = n

Measuring Performance

  • Elapsed time (wall clock time) (=response time) : total time (테스크 수행 시간, 메모리 접근등 모든 시간)
  • CPU time : 테스크를 수행할 때 CPU가 사용하는 시간. 두가지로 나뉜다.
    - user CPU time : 프로그램에서 쓰는 시간
    - system CPU time : 프로그램을 대신하여 운영체제에서 테스크를 수행한 시간

  • system performance - elapsed time
  • CPU performance - user CPU time
    두가지로 구분해서 performance를 측정하고 각각은 다른 기준으로 측정한다.

  • clock cycle : 컴퓨터에서 사용하는 이산 시간 간격
  • clock period : 1 clock cycle동안 걸린 시간 (s)
  • clock rate (frequency) : 1초에 clock cycle이 몇개 있는지 단위는 Hz
    - ex) 4.0GHz => 1초에 4.01094.0*10^9번의 clock cycle존재

CPU Performance and Its Factors


그림 1. CPU execution time

그림 1과 같이 CPU execution time을 계산한다.
clock cycle의 수 또는 길이를 줄여 성능을 향상시킬수 있다. 하지만 프로그램에 필요한 clock cycle과 trade-off에 직면할 때가 많다. 또한 clock cycle 수를 줄이는 것이 clock cycle time을 증가시킬 수도 있다.

Instruction Performance

compiler가 instructions을 실행하는 시간도 performance에 영향을 준다.

그림 2. instructions 수행시간이 performance에 주는 영향

  • CPI : clock cycles per instruction
    - 서로 다른 instruction은 다른 수행 시간을 가진다. 따라서 평균을 내어 performance를 측정한다.

    CPI는 사용하는 프로그램에 따라 달라진다. 즉, CPU의 고유한 성질 X

The Classic CPU Performance Equation


그림 3. CPU Time

  • instruction count : 프로그램에서 실행되는 instruction의 수


    그림 4. 성능 측정의 기본 요소들

성능에 영향을 주는 HW/SW 요소

  • Algorithm - Instruction count, possibly CPI
  • Programming language - Instruction count, CPI
  • Compiler - Instruction count, CPI
  • Instruction set architechture - Instruction count, clock rate, CPI

Reference

[1] D. Patterson and J. Hennessy, ⌜Computer Organization and Design, 5th Edition⌟ , chapter 1
profile
설계 엔지니어 지망생

0개의 댓글