| Section | Title |
|---|---|
| 1 | What Actually Makes Programs Slow? |
| 2 | Why Profiling Matters |
| 3 | The Basic Idea |
| 4 | Why SIMD Matters |
| 5 | Why Allocations Cost Time |
| 6 | Small Values Are Fine to Copy |
| 7 | Why Branch Prediction Exists |
| 8 | Benchmark the Right Thing |
| 9 | The Basic Idea |
| 10 | Case Study 1: Reusing a Temporary Buffer |
What Actually Makes Programs Slow?Performance is one of the main reasons people choose Zig.
Why Profiling MattersWhen a program feels slow, your first job is not optimization.
The Basic IdeaModern CPUs are fast, but memory is much slower.
Why SIMD MattersSIMD means Single Instruction, Multiple Data.
Why Allocations Cost TimeAllocations are one of the most common causes of slow programs.
Small Values Are Fine to CopyCopying data is sometimes necessary, but unnecessary copying is one of the easiest ways to waste time and memory.
Why Branch Prediction ExistsBranch prediction is a CPU optimization.
Benchmark the Right ThingBenchmarking means measuring how fast code runs.
The Basic IdeaAn abstraction is a way to hide detail behind a simpler interface.
Case Study 1: Reusing a Temporary BufferPerformance ideas become clearer when you see them inside real code.