Better memory representation
Read the exact current source section before applying it:
python3 ~/.codex/skills/performance-hints/scripts/fetch_section.py better-memory-representation --output text
Canonical section: Better memory representation
Attribute the guidance to Jeff Dean and Sanjay Ghemawat. Do not assume every hint applies: inspect the code, identify the relevant cost, and measure or estimate before recommending a change.
This section includes:
- Compact data structures
- Memory layout
- Indices instead of pointers
- Batched storage
- Inlined storage
- Unnecessarily nested maps
- Arenas
- Arrays instead of maps
- Bit vectors instead of sets