Entity-Component-System Benchmarks for Unity

April 8, 2026 · View on GitHub

License Stars

This repository contains a collection of benchmarks for Unity Entity-Component-System (ECS) frameworks. Benchmarks perform a complex performance comparison of ECS frameworks on a near-real-world scenario.

.NET Version

Frameworks:

ECSVersion / SourceImplemented
DragonECS0.9.21
Friflo Engine ECSlocal precompiled assemblies in Assets/lib/netstandard2.1 (Friflo.Engine.ECS 3.5.0)
LeoECSLite2025.4.22
Massive ECSv20.1.1
Morpeh2024.1.1
StaticEcsv2.0.3
Unity Entitiescom.unity.entities 6.4.0

Scenario

All benchmark implementations run the same deterministic simulation.

At startup, the benchmark creates N units. During spawn, each unit receives a type (NPC, Hero, or Monster), combat stats, position, and movement state. Each tick then runs the same gameplay pipeline: spawning and respawning, target selection, attack creation, damage application, movement, velocity updates, and rendering into a framebuffer.

This makes the benchmark closer to a small RTS-like combat loop than to a synthetic ECS microbenchmark.

Tick Pipeline

Each benchmark context executes the same logical steps:

  1. Spawn / Respawn / Kill
  2. Render current state into framebuffer
  3. Update unit sprite state
  4. Apply damage from pending attacks
  5. Create new attacks
  6. Move units
  7. Update velocity
  8. Advance simulation data

Validation

Benchmark implementations are validated by shared tests. For the same entity count and tick count, all contexts must produce the same framebuffer hash. This ensures the comparison is based on equivalent simulation results, not on different behavior.

Running

  1. Install Unity Hub and Unity 6000.4.1f1

  2. Clone repository

    git clone https://github.com/cNoNim/ecs-benchmark-runner-unity.git
    
  3. Open the project in Unity

  4. Run tests from Unity Test Runner

  5. Run benchmark scene in Play Mode

    Scene

    Assets/Benchmark.unity
    

    Results

    Application.persistentDataPath/Benchmark.md
    
  6. Build from batch mode

    /path/to/Unity/Editor/Unity \
      -batchmode \
      -quit \
      -projectPath /path/to/ecs-benchmark-runner-unity \
      -buildTarget Android \
      -executeMethod Benchmark.Editor.BenchmarkBuild.BuildBatchMode
    

Structure

The benchmark is divided into repositories. Current repository integrates benchmark packages into runner scene and Unity test assemblies.

Benchmark.Core Package

A separate repository contains common assemblies that are used by benchmarks or by infrastructure. Integration is done through the ecs.benchmark.core package.

Benchmark Packages

Each benchmark is a separate repository, integration is done through packages referenced in Packages/manifest.json.

RepositoryPackage / Assembly
Dragon ECSecs.benchmark.dragonecs
FriFlo ECSecs.benchmark.frifloecs
LeoEcsLiteecs.benchmark.ecslite
Massive ECSecs.benchmark.massiveecs
Morpehecs.benchmark.morpeh
StaticEcsecs.benchmark.staticecs
Unity Entitiesecs.benchmark.entities

Dependencies

Frameworks can be referenced:

Benchmark.Runner

Runner scene includes all benchmarks from referenced runtime assemblies. Active runtime references are declared in Assets/Benchmark.Runner.asmdef.

Performance Tests

Contains Unity performance test runner project for benchmark contexts.

Hash Tests

Contains test project that validates that each benchmark produces the same state.