You shipped 10,000 entities. The profiler shows 18ms frame time. The culprit isn't your logic — it's how you laid out memory. Unity DOTS promises performance, but only if you stop treating ECS like OOP with structs.
Why Memory Layout Breaks Your Frame Budget
ECS processes data in chunks. Each archetype gets its own contiguous memory block. When you scatter unrelated components across entities, you force the CPU to jump between cache lines. Burst compiles vectorized code, but it can't vectorize what isn't contiguous.
"The fastest code is code that never misses L1 cache.
— Mike Acton, former Unity DOTS lead
Design for Archetype Stability
Every AddComponent/RemoveComponent call may move entities between archetypes. At 10k entities, that's 10k potential memory copies per frame. Instead, use enableable components or state tags.
Pack Components by Access Pattern
Components accessed together should live in the same struct. The Burst compiler auto-vectorizes loops over IComponentData arrays — but only when fields are adjacent in memory.
Use ISharedComponentData for Rarely Changing Data
Material indices, layer masks, or team IDs change once per entity lifetime. Put them in ISharedComponentData. Unity groups entities by shared component value, creating natural batching for rendering and broadphase.
| Component Type | Changes/Frame | Best Practice |
|---|---|---|
| Transform | 10,000 | IComponentData (packed) |
| Health | 500 | Enableable IComponentData |
| MaterialID | 0 | ISharedComponentData |
| TeamID | 0 | ISharedComponentData |
Profile With Burst Inspector, Not Profiler Alone
The Unity Profiler shows managed overhead. Burst Inspector shows assembly. Look for 'ldr'/'str' instruction density — high density means cache-friendly. Low density with many 'bl' calls means function call overhead from fragmented memory.
Your 2026 Checklist Before Shipping
- Audit every structural change — replace with enableable components or tags
- Group co-accessed fields into single IComponentData structs
- Move immutable data to ISharedComponentData
- Run Burst Inspector on hot systems — verify vectorized loops
- Test on target hardware: Steam Deck, mobile, low-end desktop
✦
Memory layout isn't optimization — it's correctness. Get it right, and 10k entities run at 60fps on integrated graphics. Get it wrong, and no amount of Burst attributes saves you.









