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 fb23b31 2 files · 1.0 KB Updated

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/tree/main/skills/performance-allocations commit fb23b31396

Frequently asked questions

npx skillmds@latest add boshjerns/performance-allocations