Performance Allocations

Use Jeff Dean and Sanjay Ghemawat's canonical allocation guidance. Use when reducing heap traffic, copies, container growth, temporary construction, or repeated allocation in hot paths.

boshjerns Updated 1 repo stars
The Performance Hints page on the Abseil website, showing the title, authors, update date, and section navigation

File contents

Reduce allocations

Read the exact current source section before applying it:

python3 ~/.codex/skills/performance-hints/scripts/fetch_section.py reduce-allocations --output text

Canonical section: Reduce allocations

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:

  • Avoid unnecessary allocations
  • Resize or reserve containers
  • Avoid copying when possible
  • Reuse temporary objects

boshjerns/performance-hints-agent-skills commit fb23b31396

Frequently asked questions

npx get-skill add boshjerns/performance-allocations