EasyEcs

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
EasyEcs 78.7 μs, Arch 1.21 ms
  • EasyEcs78.7 μs
  • Arch1.21 ms

Benchmarks EasyEcs is faster in

16/ 18
of those both libraries take part in, beyond the measurement error

Arch's time for the server tick

3.4×
relative to EasyEcs, 100,000 entities

Arch allocates per tick

535KB
EasyEcs allocates 0 B

BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

At a glance

EasyEcsArch
Storagearchetype tables, presence bits per columnarchetypes in chunks
Changes during a queryapplied at oncerecorded in a CommandBuffer, played back later
Removing a componentflips a bit, the entity keeps its rowmoves the entity to another archetype
Systemsbuilt in, generated from [ForEach] methodsArch.Extended
Change and removal tracking[Changed<T>], [Removed<T>]events (SubscribeComponentSet, SubscribeComponentRemoved)
Indexes, relations, hierarchybuilt inrelations in a separate package
Allocation per server ticknonethe command buffer allocates
Runtimesnet10.0netstandard2.1, net6.0, net8.0; Unity

Concepts side by side

ConceptArchEasyEcs
WorldWorld.Create(), World.Destroy(world)new World(), world.Dispose()
Componentany structa struct implementing IComponent
Tagan empty structan empty struct implementing IComponent
Singletonnone (a component on one entity)ISingletonComponent, world.AddSingleton<T>()
Querynew QueryDescription().WithAll<A, B>().WithNone<C>()[ForEach, Without<C>] on a method; QueryFilter.Create().Without<C>() for ad-hoc calls
Struct jobIForEach<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 entityIForEachWithEntity<A>, InlineEntityQueryIForEachEntity<A>, ForEachEntity, or an Entity parameter of a [ForEach] method
Chunksworld.Query(in query).GetChunkIterator(), then chunk.GetSpan<T>()batch [ForEach] methods taking Span<T>, or ForEachBatch
SystemArch.Extended BaseSystemEcsSystem with [ForEach] methods
Command bufferCommandBuffer, Playback(world)none: entity.SetFire(10), RemoveFire(), Destroy() apply at once
Bulk changeworld.Add(in query, value), world.Remove<T>(in query)world.SetAll(value, filter), world.RemoveAll<T>(filter)
Reserve before creatingworld.EnsureCapacity(in signature, n)world.EnsureCapacity<A, B>(n), or world.CreateEntities(span, a, b) at once
Parallel queryWorld.SharedJobScheduler, InlineParallelQuery[ForEach(Parallel = true)]
EventsSubscribeComponentAdded / Removed / Setnone: [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).

CombatSystem.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 measuredEasyEcsArchIts time vs EasyEcsWhy
Add a component to 100,000 entities by query, then remove it78.7 μs1.21 ms15×
Add and remove a tag in the passes that find them (1,000 of 100,000)163 μs1.12 ms, 448 KB allocated6.9×
The full server tick: nine systems over 100,000 entities1.68 ms5.76 ms, 535 KB allocated3.4×
Spawn 10,000 entities beside 100,000, then destroy them138 μs409 μs2.96×
The full server tick: nine systems over 10,000 entities175 μs482 μs, 65.9 KB allocated2.76×
Put 10,000 of 100,000 entities to sleep, wake the last ones478 μs1.26 ms2.63×
Find the 1,000 of 100,000 entities that lost a component66.7 μs172 μs2.58×
Scan 100,000 entities for the 10 written, without a change filter38.2 μs91.9 μs2.40×
Add and remove a tag in the passes that find them (10 of 100,000)78.2 μs184 μs, 5.30 KB allocated2.36×
Find the 10 of 100,000 entities that lost a component830 ns1.81 μs2.18×
Find the 1,000 of 100,000 entities written this tick38.5 μs84.0 μs2.18×
Put 100 of 100,000 entities to sleep, wake the last ones41.4 μs82.8 μs2.00×
Find the 10 of 100,000 entities written this tick507 ns966 ns1.91×
Scan 100,000 entities for the 1,000 written, without a change filter61.4 μs109 μs1.77×
Create 100,000 three-component entities one by one in a fresh world, room reserved first2.60 ms, 3.44 MB allocated4.21 ms, 4.62 MB allocated1.62×
Create 100,000 three-component entities in a fresh world in one call (the others' fastest way)2.71 ms, 4.96 MB allocated4.21 ms, 4.62 MB allocated1.56×
Steer 100,000 agents on all cores (parallel query)766 μs685 μs0.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 reserved7.13 ms, 8.97 MB allocated4.77 ms, 4.84 MB allocated0.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.
BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

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
EasyEcs 4.60 B per tick1.68 msFriflo.Engine.ECS 3.61.08× · 0 B per tick1.83 msArch 2.13.4× · 535 KB per tick5.76 msDefaultEcs 0.173.7× · 60.9 KB per tick6.24 ms0.00 ns1.00 ms2.00 ms3.00 ms4.00 ms5.00 ms6.00 msTime per tick

BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

Data table
LibraryTimevs EasyEcsAllocated
EasyEcs 4.61.68 ms1.00×0 B
Friflo.Engine.ECS 3.61.83 ms1.08×0 B
Arch 2.15.76 ms3.4×535 KB
DefaultEcs 0.176.24 ms3.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
EasyEcs: Direct0 B allocated163 μsArch: CommandBuffer6.9× · 448 KB allocated1.12 ms0.00 ns200 μs400 μs600 μs800 μs1.00 ms1.20 msTime (shorter is faster)

BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

Data table
LibraryCaseMeanvs EasyEcsAllocated
EasyEcsDirect163 μs1.00×0 B
ArchCommandBuffer1.12 ms6.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
EasyEcs: Changed0 B allocated38.5 μsArch: DirtyTag2.18× · 0 B allocated84.0 μsArch: Scan2.83× · 0 B allocated109 μs0.00 ns20.0 μs40.0 μs60.0 μs80.0 μs100 μsTime (shorter is faster)

BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

Data table
LibraryCaseMeanvs EasyEcsAllocated
EasyEcsChanged38.5 μs1.00×0 B
ArchDirtyTag84.0 μs2.18×0 B
ArchScan109 μs2.83×0 B

10,000 of 100,000 units fall asleep and wake up, then the awake are summed

  • EasyEcs
  • Arch
TagArch 2.63×478 μs · 0 B1.26 ms · 0 B0.00 ns200 μs400 μs600 μs800 μs1.00 ms1.20 msTime (shorter is faster)

BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

Data table
LibraryCaseMeanvs EasyEcsAllocated
EasyEcsTag478 μs1.00×0 B
ArchTag1.26 ms2.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
EasyEcs: SetAllRemoveAll0 B allocated78.7 μsArch: AddRemoveByQuery15× · 0 B allocated1.21 ms0.00 ns200 μs400 μs600 μs800 μs1.00 ms1.20 msTime (shorter is faster)

BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

Data table
LibraryCaseMeanvs EasyEcsAllocated
EasyEcsSetAllRemoveAll78.7 μs1.00×0 B
ArchAddRemoveByQuery1.21 ms15×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
PerEntityArch 0.67×7.13 ms · 8.97 MB4.77 ms · 4.84 MBPerEntity_ReservedArch 1.62×2.60 ms · 3.44 MB4.21 ms · 4.62 MBBulk2.71 ms · 4.96 MB0.00 ns1.00 ms2.00 ms3.00 ms4.00 ms5.00 ms6.00 ms7.00 ms8.00 msTime (shorter is faster)

BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

Data table
LibraryCaseMeanvs EasyEcsAllocated
EasyEcsPerEntity7.13 ms1.00×8.97 MB
ArchPerEntity4.77 ms0.67×4.84 MB
EasyEcsPerEntity_Reserved2.60 ms1.00×3.44 MB
ArchPerEntity_Reserved4.21 ms1.62×4.62 MB
EasyEcsBulk2.71 ms1.00×4.96 MB

Steer 100,000 agents on all cores

  • EasyEcs
  • Other libraries
EasyEcs: Parallel0 B allocated766 μsArch: InlineParallelQuery0.89× · 0 B allocated685 μs0.00 ns100 μs200 μs300 μs400 μs500 μs600 μs700 μs800 μsTime (shorter is faster)

BenchmarkDotNet 0.15.2, .NET 10.0.13, Intel Xeon Processor 2.10GHz, 4 cores, Ubuntu 24.04.5 LTS.

Data table
LibraryCaseMeanvs EasyEcsAllocated
EasyEcsParallel766 μs1.00×0 B
ArchInlineParallelQuery685 μs0.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. InlineParallelQuery on 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.

Edit on GitHub

Last updated on

How is this guide?

On this page