Optimizing Memory Performance

Audits measured memory and allocation performance.

socketdev 0c20796 945 B Updated

File contents

Optimizing Memory Performance

Separate allocation rate, allocation bytes, retained heap/RSS, locality, and peak memory. An optimization that removes allocations but retains an oversized arena or buffer can lose.

  1. Read memory audit and, for parsers, parser data-oriented design.
  2. Scan for unbounded capacity growth, copied text, per-item allocation, retained source buffers, pointer-rich structures, object-per-token records, and pools without ownership.
  3. Establish capacity bounds and reset/eviction rules before adding reuse, arenas, pools, or interning.
  4. Benchmark allocation count/bytes, peak RSS/heap, GC/allocator time, locality-sensitive throughput, and tiny-input startup separately.

socketdev/socket-btm/tree/main/.claude/skills/fleet/optimizing-memory-performance commit 0c20796b6a

Frequently asked questions

npx skillmds@latest add socketdev/optimizing-memory-performance