game-perf

Reduce per-frame allocations and GC pressure in game loops with reusable buffers and pooling.

11|5|Updated Jan 9, 2026
One-click install
npx skills add https://github.com/rbergman/dark-matter-marketplace --skill game-perf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: game-perf
Source: https://github.com/rbergman/dark-matter-marketplace/tree/main/plugins/game-dev/skills/game-perf
Command: npx skills add https://github.com/rbergman/dark-matter-marketplace --skill game-perf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill reduces per-frame allocations and GC pressure in game loops, enabling smoother frames and lower latency.

Core Features & Use Cases

  • Allocation-free patterns for hot-path game code to minimize garbage collection pauses.
  • Clear guidance on avoiding common allocations (spread, map, filter, object literals) in tight loops.
  • Techniques such as in-place updates, scratch buffers, and object pooling for frequent objects.
  • Use Case: when updating many entities per frame, apply these patterns to keep frame budgets stable.

Quick Start

Apply the zero-allocation patterns to a per-frame update loop and verify frame-time improvements.

Frequently Asked Questions about game-perf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce garbage collection pauses in my game loop?

Reduce garbage collection pauses by applying allocation-free patterns to your game loop. This skill enforces in-place updates, object pooling, and reusable scratch buffers to minimize per-frame allocations and stabilize frame times.

Why does using map, filter, or spread operators cause frame drops in my update loop?

Using map, filter, or spread operators causes frame drops because they generate temporary objects inside the update loop. These per-frame allocations increase GC pressure, which leads to latency spikes and uneven frame pacing during gameplay.

What is the best way to handle per-frame allocations for particle systems and collision detection?

The best way to handle per-frame allocations for particle systems and collision detection is implementing object pooling and context objects. Reusing objects instead of allocating new ones prevents garbage collection pauses in tight physics and render paths.

Can I apply zero-allocation patterns to AI update code and render paths?

Yes, you can apply zero-allocation patterns to AI update code, render paths, and physics loops. The skill targets all per-frame code, enforcing allocation-free techniques like reusable buffers to ensure smoother frames and lower latency.

When should I not use object pooling for frequent game objects?

You should not use object pooling for objects that are rarely instantiated or destroyed, as the pool memory overhead outweighs the benefits. Pooling is specifically for frequent, per-frame allocations in hot-path game code like entity updates.