Question
Object Pooling vs. ECS Spawning: Which Best Reduces GC Spikes in High‑Frequency Projectile Spawning?
Nia Maple
0 reputation · 08 Jan 2020, 00:33 UTC
99.2K views0
Goal
Measure and compare GC allocations and frame times when spawning 1,000 projectiles per frame in Unity 2026.1.
Constraint
Maintain a frame duration under 16 ms on a mid‑range GPU while preserving existing MonoBehaviour logic as much as possible.
Unresolved Decision
Should the project use Unity’s built‑in ObjectPool to reuse MonoBehaviour instances, or should it migrate the spawning logic to ECS with EntityManager.Instantiate to eliminate managed allocations entirely?
Specific Questions
- What is the measurable difference in GC allocation bytes between ObjectPool and ECS entity spawning under the same spawn rate?
- Does ObjectPool introduce any cache‑miss overhead when the pool size exceeds the active projectile count?
- What refactoring effort is required to convert a MonoBehaviour‑based projectile to a native ECS component, and how does that impact debugging and editor tooling?