Compression Digest
compression/_posts/2017-05-16-an-overview-of-computer-system.md
CSAPP 读书笔记摘要
[Literal] Summary notes from *A Programmer's Perspective* (CSAPP): performance trade-offs, memory hierarchy locality, linking, and exceptional control flow. [AI Synthesis] Recurring theme: measure where time goes (Amdahl, profiling) before micro-optimizing.
Key points
- [Literal] Ch5: Trade-off between ease of maintenance and speed—pick algorithms/data structures; help the compiler; reduce excessive calls and redundant memory refs.
- [Literal] Amdahl's Law: speedup depends on how much you improve a part and what fraction of total time it was.
- [Literal] Ch6: SRAM (cache) vs DRAM vs SSD vs disk—bridge CPU–memory gap via hierarchy and locality (temporal + spatial).
- [Literal] Good locality: reuse data (temporal) and scan sequentially stride-1 (spatial) to stay in fast caches.
- [Literal] Ch7: Linking resolves symbols then relocates addresses; static libs copy referenced modules; shared libs defer code/data linking to load time.
- [Literal] Ch8: Exceptional control flow—processor control transfers from aₖ to aₖ₊₁ (notes continue in source).
Patterns / reminders
- [AI Synthesis] Profile first, then attack the largest fraction per Amdahl—not the easiest line to tweak.