Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.
This article also participated in the “Digitalstar Project” to win a creative gift package and creative incentive money
Computer system performance evaluation
<1> Non-time indicator
1) Machine word length: refers to the number of binary bits that the machine can process at one time
- It is determined by the number of adder and register
- Generally equal to the number of bits in the internal register (word length)
- The longer the word length, the greater the range and accuracy of the data represented
- 32-bit and 64-bit word lengths are common
2) Bus width: the maximum number of bits of information that the data bus can transmit in parallel at one time
- Generally refers to the data bus number between the arithmetic unit and the memory
- Some computers have inconsistent internal and external data bus widths
- 8086, 80286, 80386 internal data bus equal width
- 8088, 80386SX external bus width 8 bits, internal bus width 16 bits
- Pentium external bus 64-bit, internal bus 32-bit (two 32-bit pipeline)
3) Main storage capacity and storage bandwidth
- Main memory capacity: refers to the total number of storage units contained in the main memory of a computer
- Storage bandwidth: refers to the amount of binary information exchanged with main memory per unit of time, usually in B/s (byte/second). (Indicators that affect storage bandwidth include data bit width and data transmission rate)
<2> Time indicator
1) Main frequency F/clock period T, external frequency, frequency doubling
- Frequency f
- Refers to the CPU core working clock frequency, that is, the CPU digital pulse signal vibration rate, and the ACTUAL CPU computing capacity is not unique, direct relationship
- Clock cycle
- Also known as the beat period, is the most basic and smallest unit of time in a computer. In a clock cycle, the CPU performs only one basic action
- The relation between F and T
- The inverse of each other, the higher f, the smaller T (f = 100MHz T = 10ns, f = 1GHz T = 1ns)
- The outer frequency
- The clock frequency synchronized between the CPU(memory) and the mainboard
- Frequency doubling
- Multiple between CPU main frequency and external frequency
For example, Pentium 4 2.4 gb CPU main frequency 2400M = 133M(external frequency) x 18(double frequency)
2) CPI(Clock Cycles Per Instruction)
- Number of clock cycles (i.e. T cycles) required to execute an instruction (average)
- CPI of single instruction, CPI of all instructions in a program, CPI of instruction system, etc
CPI = total number of clock cycles of all instructions in the program/total number of instructions in the program
= ∑\sum∑(CPI of each instruction in the program × proportion of each instruction in the program)
CPI Application Examples
For example, the proportion and CPI of various instructions in a computer instruction system are shown in the following tableCopy the code
Instructions type | | the CPI
- | – | –
Arithmetic and logical | 1 | 60% Load/Store transfer 4 | | | | 2 18% 12% loss of Cache to fetch | | 8 10%
Solution: CPI = 1*60% + 2*18% + 4*12% + 8*10% = 2.24
- IPC (Instruction per Clock)
- Number of instructions executed per clock cycle (in parallel)
3) MIPS (Million Instructions Per Second)
-
Total number of instructions per second that the CPU can execute (million instructions per second)
MIPS = Number of instructions/(Execution time x 106) = Number of instructions/(Sum of CPU clock cycles of all instructions/f x 106) = F/(CPI x 106) (Full performance formula)
Example of MIPS application
For example, the main frequency of a computer is 1GHz, and the object code running on it contains 2×10<sup>5</sup> instructions, which are divided into 4 categories. The proportion of each instruction and their RESPECTIVE CPI are shown in the following table, and the MIPS of the program is obtainedCopy the code
Instructions type | | CPI mixture ratio
- | – | –
Arithmetic and logical | 1 | 60% Load/Store transfer 4 | | | | 2 18% 12% loss of Cache to fetch | | 8 10%
Solution: According to the CPU full performance formula: MIPS = F/(CPI x 106) CPI = 1 x 60% + 2 x 18% + 4 x 12% + 8 x 10% = 2.24 MIPS = F/(CPI x 106) = 1 x 109 / (2.24) x 106 = 446.4
4) CPU time
- The time required to execute a program
- (CPU time + I/O time + storage access time + queuing delay
CPU time = total number of clock cycles of all instructions in the program × T
= Sum of clock cycles of all instructions in the program/f
Calculation method of CPU time
- CPU time after CONSIDERING CPI:
CPU time = Total instructions x ∑ I =1n\ Sum_ {I =1}^n∑ I = 1N (CPIi x ICi/Total instructions) x clock cycle time = Total instructions x CPI x T
- CPU time after considering MIPS:
MIPS = Number of instructions/(time of instruction execution × 106) Time of program execution t = Number of instructions/(MIPS × 106)
Example of CPU time application
For example, the main frequency of a computer is 1GHz, and the object code running on it contains 2×105 instructions, which are divided into 4 categories. The proportion of each instruction and their RESPECTIVE CPI are shown in the following table, and the CPU time of this program is calculated
Instructions type | | CPI mixture ratio
- | – | –
Arithmetic and logical | 1 | 60% Load/Store transfer 4 | | | | 2 18% 12% loss of Cache to fetch | | 8 10%
Solution: Method 1: Use CPI CPU time = 2 × 105 × CPI/f = (2 × 105 × 2.24/109) = 4.48 × 10-4(s)
Solution: Method 2: Use MIPS CPU time = instruction quantity/(MIPS × 106) = 2 × 105 / ((103/2.24) × 106) = 4.48 × 10-4(s)
<3> Thinking about the application of time index
-
How to use time index to evaluate computer performance
- F, CPI, MIPS, CPU time in evaluating computer performance characteristics and shortcomings?
- How to test the comprehensive performance of computer system scientifically and reasonably? What are the common testing tools? Do the test results really reflect the actual performance of the computer?
-
Are computer performance indicators fixed?
How to use time index to evaluate computer performance – the characteristics and shortcomings of F, CPI, MIPS and CPU time in evaluating computer performance? How to test the comprehensive performance of computer system scientifically and reasonably? What are the common testing tools? Do the test results really reflect the actual performance of the computer?
- Are computer performance indicators fixed?
Finally, welcome to pay attention to my personal wechat public account “Little Ape Ruochen”, get more IT technology, dry goods knowledge, hot news