# Performance Memory Representation

> Use Jeff Dean and Sanjay Ghemawat's canonical memory-representation guidance. Use when tuning cache locality, object size, pointer density, container layout, batched or inline storage, maps, sets, bit vectors, or arenas.

- Skill: `boshjerns/performance-memory-representation` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add boshjerns/performance-memory-representation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/boshjerns/performance-memory-representation/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: boshjerns (https://skillmd.com/u/boshjerns)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/boshjerns/performance-memory-representation

---


# Better memory representation

Read the exact current source section before applying it:

```bash
python3 ~/.codex/skills/performance-hints/scripts/fetch_section.py better-memory-representation --output text
```

Canonical section: [Better memory representation](https://abseil.io/fast/hints#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


