liveBook · Manning

Chapter 1: Understanding data-oriented design

What you will learn in chapter 1 of High Performance Unity Game Development

Introduces data-oriented design as a way to organize Unity game code around data flow, explains its main benefits, and distinguishes it from Unity DOTS and ECS.

After this chapter you will be able to

Section by section

Introduction

Introduces data-oriented design as a way to organize Unity game code around data flow, explains its main benefits, and distinguishes it from Unity DOTS and ECS.

Key terms: Data-Oriented Design, DOD, flow and transformation of data, data-first approach, memory, dependencies, extensibility, DOTS, ECS

1.1 Core advantages of data-oriented design

This section explains how data-oriented design can improve gameplay performance, reduce code complexity, and make features easier to extend.

Key terms: DOD, data, CPU, object-oriented layouts, code complexity, execution paths, transformations, separating data from logic, extensibility, data flow

1.1.1 Where DOD provides the most value

This section identifies where data-oriented design (DOD) is useful in Unity, where it will not help, and why a hybrid approach is often appropriate.

Key terms: DOD, data-first architecture, gameplay systems, arrays, batches, bottleneck, GameObjects, MonoBehaviours, hybrid approach, indices

1.2 Improving performance by leveraging modern hardware architecture

This section argues that data-oriented design provides a performance-conscious foundation rather than premature optimization, while emphasizing the need to profile on target hardware.

Key terms: Data-Oriented Design, data locality, cache line, batching, vectorization, parallel execution, premature optimization, profile, target hardware, bottlenecks

1.2.1 Why memory access limits performance

This section uses enemy movement to show why waiting for data can limit performance and why DOD organizes data to make better use of the CPU cache.

Key terms: position, direction, velocity, Move(), main memory, CPU cache, register, access latency, DOD, logic

1.2.2 Why the CPU cache is faster than main memory

This section explains why accessing data in the CPU cache is faster than retrieving it from main memory and how data-oriented design can improve the chances of finding needed data in the cache.

Key terms: CPU cache, L1 cache, main memory, cache hit, cache miss, cache levels, Data-Oriented Design, L1 cache hits, cache misses

1.2.3 How the CPU retrieves data into the cache

The section explains how a cache line brings nearby data into the CPU cache and why placing related values close together can make a memory retrieval more useful.

Key terms: cache line, main memory

1.2.4 How cache lines move data into the CPU cache

This section explains how cache lines bring blocks of memory toward the CPU and why keeping an enemy’s related movement data in one aligned cache line can reduce memory trips.

Key terms: cache line, L1 cache, L2 cache, L3 cache, main memory, data locality, m_position, m_direction, m_velocity, address alignment

1.2.5 Using data locality to reduce cache misses

This section explains how grouping enemy data in arrays improves data locality and helps reduce CPU cache misses.

Key terms: data locality, cache line, cache-line address alignment, Enemy object, Structure of Arrays, SoA, contiguous memory, MoveAllEnemies(), cache miss, position[0]

1.3 Reducing code complexity by separating data and logic

The section shows how separating runtime data from logic lets gameplay systems transform the data they need without organizing every enemy behavior around objects or components.

Key terms: Data-Oriented Design, runtime data, static functions, input data, transformation, output data, position, direction, velocity, Teleporting Robot

1.4 Improving extensibility by solving for data

The section uses a new enemy feature to show how defining behavior through data and transformations can make extensibility more predictable than fitting changing behaviors into object relationships.

Key terms: Zombie Duck, velocity, static enemy, data, logic, inheritance, composition, components, overlapping data, reusable architecture

1.5 Unity DOTS, ECS, and how they relate to DOD

This section distinguishes data-oriented design from Unity DOTS and ECS, explains the basic ECS roles, and shows why data layout and practical tradeoffs matter more than adopting a particular tool.

Key terms: Data-Oriented Design, DOD, Unity DOTS, ECS, Burst, SIMD, Jobs, TransformAccessArray, Entity, Component

1.6 Summary

Summarizes how data-oriented design improves performance, reduces code complexity, supports extensibility, and relates to ECS and Unity DOTS.

Where this is used later

Concepts explained in this chapter

Chapter 2: Structuring data for performance →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.