Intro
Great Reality 1: Integers are not integers, Floats are not Reals
Example 1: Is x^2 >= 0?
- Float: yes
- Ints: 50000 * 50000 < 0
Example 2: Is (x + y) + z = x + (y + z)?
- Unsigned & Signed Int: Yes
- Floats: (1e20 + -1e20) + 3.14 = 3.14 1e20 + (-1e20 + 3.14) = ?
Greate Reality 2: You’ve got to know assembly
Understanding assemply is key to machine-level execution model
- Behavior of programs in presence of bugs
- Tuning program performance: understand source of program inefficiency
- Implementing system software
- Creating / fighting malware
Memory Matters: Random access memory is an unphysical abstraction
- Memory is not unbounded: It must be allocated and managed
- Memory referencing bugs especially pernicious
- Memory performance is not uniform
- Cache and virtual memory effects can greatly affect program performance
- Adapting program to characteristics of memory system can lead to major speed improvements
There’s more to performnce than asymptotic complexity
- Constant factors matter too
- And even exact op count does not pretict performance
- Easily see 10:1 performance range depending on how code written
- Must optimize at multiple levels: algorithm, data representations, procedures, and loops
- Must understand system to optimize performance
- How programs compiled and executed
- How to measure program performance and identify bottlenecks
- How to improve performance without destroying code modularity and generality
Computers do more than execute programs
- They need to get data in and out
- I/O system critical to program reliability and performance
- They communicate with each other over networks
- Many system-level issues arise in presence of network
- Concurrent operations by autonomous processes
- Coping with unreliable media
- Cross platform compatibility
- Complex performance issues
- Many system-level issues arise in presence of network