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 Updated 1 repo stars
The Performance Hints page on the Abseil website, showing the title, authors, update date, and section navigation

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 commit 79283c4a92

Frequently asked questions

npx get-skill add boshjerns/performance-memory-representation