EasyEcs vs Arch
EasyEcs and Arch side by side: how the concepts map, the same systems in both, the measured server tick and features, and when Arch is the better choice.
Arch and EasyEcs are both archetype ECS libraries for C#: entities with the same components share a table, and queries walk its columns. They differ in what the core does for you. Arch is a small, fast core: queries, struct jobs, chunks and a command buffer, with systems and source generators in the separate Arch.Extended packages. EasyEcs puts systems, generated jobs, change tracking, indexes, relations, saves and snapshots in one package for .NET 10 servers, and applies structural changes immediately instead of through a command buffer.
In the 18 head-to-head benchmarks both libraries take part in, EasyEcs is faster in 16, within the measurement error in 1 and slower in 1. On the same server tick of 100,000 entities, Arch takes 3.4× the time of EasyEcs and allocates 535 KB per tick, where EasyEcs allocates 0 B. Arch runs on more runtimes (netstandard2.1, net6.0, net8.0 and Unity); EasyEcs needs .NET 10.
Add a component to 100,000 entities by query, then remove it, vs Arch
15×faster- EasyEcs78.7 μs
- Arch1.21 ms
Benchmarks EasyEcs is faster in
16/ 18Arch's time for the server tick
3.4×Arch allocates per tick
535KBBenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.
At a glance
| EasyEcs | Arch | |
|---|---|---|
| Storage | archetype tables, presence bits per column | archetypes in chunks |
| Changes during a query | applied at once | recorded in a CommandBuffer, played back later |
| Removing a component | flips a bit, the entity keeps its row | moves the entity to another archetype |
| Systems | built in, generated from [ForEach] methods | Arch.Extended |
| Change and removal tracking | [Changed<T>], [Removed<T>] | events (SubscribeComponentSet, SubscribeComponentRemoved) |
| Indexes, relations, hierarchy | built in | relations in a separate package |
| Allocation per server tick | none | the command buffer allocates |
| Runtimes | net10.0 | netstandard2.1, net6.0, net8.0; Unity |
Concepts side by side
| Concept | Arch | EasyEcs |
|---|---|---|
| World | World.Create(), World.Destroy(world) | new World(), world.Dispose() |
| Component | any struct | a struct implementing IComponent |
| Tag | an empty struct | an empty struct implementing IComponent |
| Singleton | none (a component on one entity) | ISingletonComponent, world.AddSingleton<T>() |
| Query | new QueryDescription().WithAll<A, B>().WithNone<C>() | [ForEach, Without<C>] on a method; QueryFilter.Create().Without<C>() for ad-hoc calls |
| Struct job | IForEach<A, B> with Update(ref A, ref B), run by world.InlineQuery<Job, A, B>(in query, ref job) | IForEach<A, B> with Execute(ref A, ref B), run by world.ForEach<A, B, Job>(ref job, in filter) |
| Job with the entity | IForEachWithEntity<A>, InlineEntityQuery | IForEachEntity<A>, ForEachEntity, or an Entity parameter of a [ForEach] method |
| Chunks | world.Query(in query).GetChunkIterator(), then chunk.GetSpan<T>() | batch [ForEach] methods taking Span<T>, or ForEachBatch |
| System | Arch.Extended BaseSystem | EcsSystem with [ForEach] methods |
| Command buffer | CommandBuffer, Playback(world) | none: entity.SetFire(10), RemoveFire(), Destroy() apply at once |
| Bulk change | world.Add(in query, value), world.Remove<T>(in query) | world.SetAll(value, filter), world.RemoveAll<T>(filter) |
| Reserve before creating | world.EnsureCapacity(in signature, n) | world.EnsureCapacity<A, B>(n), or world.CreateEntities(span, a, b) at once |
| Parallel query | World.SharedJobScheduler, InlineParallelQuery | [ForEach(Parallel = true)] |
| Events | SubscribeComponentAdded / Removed / Set | none: [Changed<T>], [Removed<T>], tags queried by later systems |
The same task in both
The combat system of the headline tick: fighters attack on a cooldown and some hits set the target on fire. Arch
cannot add Burning while its query iterates, so the port records the change and plays it back after the system
(ArchSimulation.cs). EasyEcs adds it on the spot (WorldSimulation.cs).
public struct Attack : IComponent { public int Damage, Cooldown, Interval; }
public struct Hp : IComponent { public int Value, Max; }
public struct Fire : IComponent { public int Ticks; }
public class CombatSystem : EcsSystem
{
[ForEach, Without<Dead>, Without<Stunned>]
static void Fight(Entity entity, ref Attack attack, ref Hp hp)
{
if (--attack.Cooldown > 0) return;
attack.Cooldown = attack.Interval;
hp.Value -= attack.Damage;
if (entity.Id.Index % 20 == 0 && !entity.HasFire)
entity.SetFire(10); // applied now, also mid-pass
}
}world.AddSystem<CombatSystem>();
world.Update();In EasyEcs the filter, the job struct and the call are generated from the method; the system's access (writes
Attack and Hp) is generated too, and the analyzer rejects a method that would break it.
The numbers
Every comparison both libraries take part in, sorted by lead (each row links to its section of the comparison):
| What is measured | EasyEcs | Arch | Its time vs EasyEcs | Why |
|---|---|---|---|---|
| Add a component to 100,000 entities by query, then remove it | 78.7 μs | 1.21 ms | 15× | |
| Add and remove a tag in the passes that find them (1,000 of 100,000) | 163 μs | 1.12 ms, 448 KB allocated | 6.9× | |
| The full server tick: nine systems over 100,000 entities | 1.68 ms | 5.76 ms, 535 KB allocated | 3.4× | |
| Spawn 10,000 entities beside 100,000, then destroy them | 138 μs | 409 μs | 2.96× | |
| The full server tick: nine systems over 10,000 entities | 175 μs | 482 μs, 65.9 KB allocated | 2.76× | |
| Put 10,000 of 100,000 entities to sleep, wake the last ones | 478 μs | 1.26 ms | 2.63× | |
| Find the 1,000 of 100,000 entities that lost a component | 66.7 μs | 172 μs | 2.58× | |
| Scan 100,000 entities for the 10 written, without a change filter | 38.2 μs | 91.9 μs | 2.40× | |
| Add and remove a tag in the passes that find them (10 of 100,000) | 78.2 μs | 184 μs, 5.30 KB allocated | 2.36× | |
| Find the 10 of 100,000 entities that lost a component | 830 ns | 1.81 μs | 2.18× | |
| Find the 1,000 of 100,000 entities written this tick | 38.5 μs | 84.0 μs | 2.18× | |
| Put 100 of 100,000 entities to sleep, wake the last ones | 41.4 μs | 82.8 μs | 2.00× | |
| Find the 10 of 100,000 entities written this tick | 507 ns | 966 ns | 1.91× | |
| Scan 100,000 entities for the 1,000 written, without a change filter | 61.4 μs | 109 μs | 1.77× | |
| Create 100,000 three-component entities one by one in a fresh world, room reserved first | 2.60 ms, 3.44 MB allocated | 4.21 ms, 4.62 MB allocated | 1.62× | |
| Create 100,000 three-component entities in a fresh world in one call (the others' fastest way) | 2.71 ms, 4.96 MB allocated | 4.21 ms, 4.62 MB allocated | 1.56× | |
| Steer 100,000 agents on all cores (parallel query) | 766 μs | 685 μs | 0.89× (within error) | Arch's and Friflo's runners keep worker threads of their own, which win when passes run back to back, as BenchmarkDotNet runs them. EasyEcs wakes thread-pool helpers only while they pay: in a real server tick a dedicated crew measured worse tail latency and more CPU per tick (D22). |
| Create 100,000 three-component entities one by one in a fresh world, nothing reserved | 7.13 ms, 8.97 MB allocated | 4.77 ms, 4.84 MB allocated | 0.67× | A fresh EasyEcs world grows its table and entity storage by doubling, and the arrays past 85,000 bytes land on the large object heap; together they pass the budget that sets off a full collection, once per new world (D28). Arch keeps entities in 16 KB chunks, which never reach that heap. Reserve the table with EnsureCapacity<T1..Tn>(count) or create the entities with CreateEntities, and EasyEcs is the fastest of the four. |
The headline tick, the same rules in both libraries, checked to produce the same counters:
One server tick of 100,000 entities: EasyEcs vs Friflo, Arch and DefaultEcs
The same simulation ported to each library's fast path, with identical results checked in setup. Shorter is faster; the badge is the time relative to EasyEcs and the memory allocated per tick.
- EasyEcs
- Other libraries
BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.
Data table
| Library | Time | vs EasyEcs | Allocated |
|---|---|---|---|
| EasyEcs 4.6 | 1.68 ms | 1.00× | 0 B |
| Friflo.Engine.ECS 3.6 | 1.83 ms | 1.08× | 0 B |
| Arch 2.1 | 5.76 ms | 3.4× | 535 KB |
| DefaultEcs 0.17 | 6.24 ms | 3.7× | 60.9 KB |
Arch takes 3.4× the time of EasyEcs on this tick and allocates 535 KB per tick, most of it in its command buffer, which pools and regrows lists while it records and plays back.
Mark 1,000 of 100,000 units dead and revive them during two passes
- EasyEcs
- Other libraries
BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.
Data table
| Library | Case | Mean | vs EasyEcs | Allocated |
|---|---|---|---|---|
| EasyEcs | Direct | 163 μs | 1.00× | 0 B |
| Arch | CommandBuffer | 1.12 ms | 6.9× | 448 KB |
Replicate the 1,000 of 100,000 entities written this tick
Arch has no change filter: a dirty tag added on write, or a scan comparing values.
- EasyEcs
- Other libraries
BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.
Data table
| Library | Case | Mean | vs EasyEcs | Allocated |
|---|---|---|---|---|
| EasyEcs | Changed | 38.5 μs | 1.00× | 0 B |
| Arch | DirtyTag | 84.0 μs | 2.18× | 0 B |
| Arch | Scan | 109 μs | 2.83× | 0 B |
10,000 of 100,000 units fall asleep and wake up, then the awake are summed
- EasyEcs
- Arch
BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.
Data table
| Library | Case | Mean | vs EasyEcs | Allocated |
|---|---|---|---|---|
| EasyEcs | Tag | 478 μs | 1.00× | 0 B |
| Arch | Tag | 1.26 ms | 2.63× | 0 B |
Stun 100,000 fighters, then lift the stun
Arch moves whole tables; EasyEcs flips presence bits once the stun has its column.
- EasyEcs
- Other libraries
BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.
Data table
| Library | Case | Mean | vs EasyEcs | Allocated |
|---|---|---|---|---|
| EasyEcs | SetAllRemoveAll | 78.7 μs | 1.00× | 0 B |
| Arch | AddRemoveByQuery | 1.21 ms | 15× | 0 B |
Create 100,000 entities of three components in a fresh world
One by one, one by one after EnsureCapacity, and EasyEcs' CreateEntities. Arch leads only without the reservation.
- EasyEcs
- Arch
BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.
Data table
| Library | Case | Mean | vs EasyEcs | Allocated |
|---|---|---|---|---|
| EasyEcs | PerEntity | 7.13 ms | 1.00× | 8.97 MB |
| Arch | PerEntity | 4.77 ms | 0.67× | 4.84 MB |
| EasyEcs | PerEntity_Reserved | 2.60 ms | 1.00× | 3.44 MB |
| Arch | PerEntity_Reserved | 4.21 ms | 1.62× | 4.62 MB |
| EasyEcs | Bulk | 2.71 ms | 1.00× | 4.96 MB |
Steer 100,000 agents on all cores
- EasyEcs
- Other libraries
BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.
Data table
| Library | Case | Mean | vs EasyEcs | Allocated |
|---|---|---|---|---|
| EasyEcs | Parallel | 766 μs | 1.00× | 0 B |
| Arch | InlineParallelQuery | 685 μs | 0.89× | 0 B |
Every other result, including the ones without Arch (Arch has no value index, hierarchy or save in its core), is on the comparison page.
What Arch does better
- The parallel query.
InlineParallelQueryon Arch's job scheduler is ahead of EasyEcs' parallel[ForEach]in this run: the scheduler keeps worker threads of its own, which wins when passes run back to back. EasyEcs chose thread-pool helpers woken only while they pay (D22); the parallel numbers of this run carry a large error. - Filling a fresh world without a reservation. Created one by one in a new world, Arch's entities take
4.77 ms against EasyEcs' 7.13 ms: EasyEcs' doubling arrays
reach the large object heap and start a full collection, Arch's 16 KB chunks never do. Reserve the table first
(
EnsureCapacity<T1, …, Tn>(n)) or create in one call, and EasyEcs is ahead (creating entities in a fresh world). - Reach. Arch runs on netstandard2.1, net6.0 and net8.0, and in Unity. EasyEcs needs .NET 10.
- A small core. If you want queries and storage and nothing else, Arch's core is smaller; systems, relations and persistence are packages you add when you need them.
- Events. Arch raises component and entity events; EasyEcs has none by design (D1).
When to choose Arch
Choose Arch when you need Unity or a runtime older than .NET 10, want a minimal core and are happy to assemble systems and tooling from Arch.Extended. Choose EasyEcs for a .NET 10 server whose state changes every tick: changes applied where they are decided, generated and analyzer-checked systems, change and removal tracking, and no allocation per tick. Porting an Arch codebase: Migrate from Arch.
Related
Last updated on
How is this guide?
EasyEcs vs Friflo.Engine.ECS
EasyEcs and Friflo.Engine.ECS side by side: how the concepts map, the same system in both, every benchmark between them, and when Friflo is the better choice.
EasyEcs vs DefaultEcs
EasyEcs and DefaultEcs side by side: archetype tables against component pools and entity sets, the same system in both, the tick, and when DefaultEcs fits.