Module 2 Flashcards

1
Q

What is a Golden Measure

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is benchmarking

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are things to check with benchmarking incl. other random shite

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is GCC optimisation

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is LUR and SFI

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can processor performance be measured with some specific tests

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can compiler optimisation work

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly