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.

boshjerns 79283c4 2 files · 1.2 KB Updated

File contents

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

boshjerns/performance-hints-agent-skills/tree/main/skills/performance-memory-representation commit 79283c4a92

Frequently asked questions

npx skillmds@latest add boshjerns/performance-memory-representation