Module 2 Flashcards
What is a Golden Measure
A golden measure is a benchmark in which the answer/output is always known. It is not usually the fastest test of a device but is one that is the most reliable.
The accuracy of the output is much more important than the speed
Examples include running simulations of something, doing hand calculations
What is benchmarking
A quantitative measure of the performance of a system
Benchmarking often uses speed but other things can be measured like cost, package, power consumption
Beware of hot boards that are sold simply to boost benchmark numbers while being rather unreliable.
What are things to check with benchmarking incl. other random shite
The biggest one is time - wall clock time
- The time taken for a task to run
- This can be a misleading metric because something could run faster but sacrifice accuracy or power usage to get there in which case it isn’t useful.
Other things that can be checked are the compiler, processor, operating system and execution time
What is GCC optimisation
They are flags that can be called before C code is run to optimise it to some degree
Some flags include:
- O1: simple optimisation
- O2: More optimisation
- O3: Space and speed optimisation that makes use of loop unrolling and small function inlining
What is LUR and SFI
Small Function Inlining takes multiple lines of code that might be redundant and puts them into fewer statements
Loop Unrolling takes loops that run for a certain number of iterations and aims to cut down on this number while preserving correctness.
How can processor performance be measured with some specific tests
MIPS and FLOPS
- MIPS measures the number of instructions executed per second
- FLOPS measures the number of floating point operations executes per second
- 1 FLOP = many MIPS
Dhrystone benchmark
- Another popular benchmark that checks for integer performance test - not always useful depending on application
How can compiler optimisation work
In the stage between the front end and the code generator - there is an intermediate stage where the compiler can be optimised.
There are three invariants that must not be broken for good optimisation
- Preserve correctness
If the thing runs faster but is less accurate that is not good.
- Performance must increase on average
- The optimisation must be worth it in the long run
If it comes at the cost of worsening power use, resource cost or something else then it isn’t good
This is done be ensuring good code selection and optimising the register allocation depending on what’s needed.