$\require{cancel}$

# 1.6 Performance

• In my opinion this is the important section of this chapter.
• We will have played with some of these ideas in the math section.
• How can we measure performance?
• Clock speed?
• Within a processor family somewhat
• Across processor families? NO
• A hummingbird has a heart rate of about 1000 BMP
• An elephant has a heart rate of about 30 BMP
• Which do you want to haul wood in a jungle?
• I got these from here.
• How about instructions per second?
• $\text{IPS} = \frac{\text{cycles}}{\text{second}} \times \frac{\text{instructions}}{\text{cycle}}$
• But it is most likely these two factors are directly related.
• Ie the difficulty of the instruction determines the length of the clock cycle.
• RISC chips do lots of little instructions very quickly (Hummingbird)
• CISC chips do a few big instructions more slowly (Elephant)
• So this is just another measurement of processor speed.
• Specialized measurements ie a test suit
• Companies have been known to cheat.
• They give an interesting table in Figure 1.14, page 29
• Comparing the throughput of various airplanes.
• The Concorde was great for moving a few people very quickly
• The airbus is great for moving many people a long way.
• Time
$\text{seconds} = \frac{\text{seconds}}{\text{cycle}} \times \frac{\text{cycles}}{\text{instruction}} \times \frac{\text{instructions}}{\text{program}}$
• These generate code in machine language
• Different compilers will generate different code.
• A compiler can optimize code.
• This rearranges, substitutes and performs other tricks on the code.
• The code still produces the same results but will run faster.
• Some compilers are better at optimization than others.
• I don't know about the validity, but here is a Comparison of some compilers.
• So compilers can change the instruction mix, hence the CPI
• They can also change the instruction count
• The ISA
• This determines CPI and Clock Speed.
• But also the instructions available for the compiler.
• The programming language
• May support abstractions that require more instructions.
• IE directly contribute to the instruction count.
• The programmer
• Instruction count, instruction mix.
• The algorithm
• The only real measurement of performance is the time for your application
• With the provided compiler
• On the machine you want to test.