## The idealized machine
![Smiley face](/img/Smiley.svg)
- Address space of named words
- Basic operations are register read/write, logic, arithmetic
- Everything runs in program order
- High-level language into "obvious" machine code
- All operations take about the same amount of time
## The real world
- Memory operations *not* all the same!
- Registers/caches lead to variable access speeds
- Memory layout affects performance (a lot)
- Instructions are non-obvious!
- Pipelining allows instructions to overlap
- Functional units run in parallel (and out of order)
- Instructions take different amounts of time
- Different costs for different orders/instruction mixes
Our goal: enough understanding to help the compiler.
## Prelude
Self-evident:
1. One should not sacrifice correctness for speed
2. One should not re-invent the wheel
3. Your time matters more than computer time
Less obvious, but still true
1. Most time goes to a few bottlenecks
2. Bottlenecks are hard to find without measuring
3. Communication is expensive (common bottleneck)
4. A little good hygiene will save your sanity
- Automate testing, time carefully, use version control
## A sketch of reality
Today, a play in two acts:
1. [One core is not so serial](/slides/2015-09-01-parallel.html)
2. [Memory matters](/slides/2015-09-01-memory.html)