Memory Layout
- Data-oriented design. Zig culture designs data layouts first: structure-of-arrays where access patterns demand.
- Packed structs. packed structs pin bit-level layouts: protocols and hardware registers as types.
- Cache thinking. Contiguous slices and linear walks win: cache behaviour designed, not discovered.
Profiling
- Profilers. Native profilers read Zig directly: perf and friends naming your functions.
- Benchmarks. Benchmarks run ReleaseFast with repetitions: measured medians over anecdotes.
- Allocator instrumentation. Custom allocators count allocations per subsystem: memory profiling built from the interface.
Systems-Level Optimisation
- comptime specialisation. comptime specialises hot paths per type and configuration: zero-cost by construction.
- SIMD with vectors. Zig’s @Vector types express SIMD portably: data parallelism in the language.
- Measure, then commit. Optimisation is measured: one change, one benchmark, keep only proven wins.
Before and after this level
- Before: Level 9: Testing & Debugging: Built-In Testing, Debugging Native Programs, Safety Modes.
- Next: Level 11: Zig Mastery: Advanced Comptime, Systems Architecture, Reading and Improving Complex Zig.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Zig Level 10: Performance cover?
Memory Layout, Profiling, Systems-Level Optimisation: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 9: Testing & Debugging, which covers Built-In Testing, Debugging Native Programs, Safety Modes.