Performance & Measuring Flashcards
Speedup
old time/new time
assuming old time is longer than new time
Amdahl’s Law equation
speedup = 1/ ( (1 - f) + (f/s) )
f is the fraction of time spend in optimisable code
s is the speed up of the optimized code
Amdahl’s Law in words
The maximum speedup of a program is limited by the fraction of the program that can not be improved.
Properties to compare processors
the time in seconds to run a program/benchmark.
time = no. of instructions x CPI x cycle period
Properties CANNOT used to compare processors
clock frequency, cycles per instructions, instruction per cycle,no. of floating point operations done per second.
What information does gprof provide?
count and measures where time is spend.
how much time the program spends running a function. Gives insight to where time is spend.
What information does gcov provide?
gives counts for each line of code. Decide which loops are most important and which if/else statements are most important to the program. Like the one ran most. Basically path most taken. Or the parts that really determine the logic of the program.
How does gprof work?
Periodically interrupts program
Observer Effect
when you want to observe how a program runs, you need to add code to it and change the way it is run.
effects: slows down execution time and size of program