ECS.CSharp.Benchmark

August 14, 2024 · View on GitHub

Performance comparison using popular ECS C# benchmark on GitHub.
Two benchmarks - subset of GitHub ⋅ Ecs.CSharp.Benchmark + PR #38 running on a Mac Mini M2.

2024-05-29 - Updated benchmarks.
Improved create entities performance by 3x to 4x and minimized entity memory footprint from 48 to 16 bytes.
Published in nuget package 2.0.0-preview.3.

Made a subset as the other benchmarks are similar only with different parameters.

  1. Create 100.000 entities with three components
  2. Update 100.000 entities with two components

1. Create 100.000 entities with three components

MethodMeanGen0Allocated
Arch6,980.1 μs-3948.51 KB
SveltoECS28,165.0 μs-4.97 KB
DefaultEcs12,680.4 μs-19517.01 KB
Fennecs24,922.4 μs-16713.45 KB
FlecsNet12,114.1 μs-3.81 KB
FrifloEngineEcs🔥405.3 μs-3625.46 KB
HypEcs22,376.5 μs6000.000068748.73 KB
LeopotamEcsLite5,199.9 μs-11248.47 KB
LeopotamEcs8,758.8 μs1000.000015736.73 KB
MonoGameExtended30,789.0 μs1000.000030154.38 KB
Morpeh_Direct126,841.8 μs9000.000083805.52 KB
Morpeh_Stash67,127.7 μs4000.000044720.38 KB
Myriad15,824.5 μs-7705.36 KB
RelEcs58,002.5 μs6000.000075702.71 KB
TinyEcs20,190.4 μs2000.000021317.2 KB

🔥 library of this project

2. Update 100.000 entities with two components

Benchmark parameter: Padding = 0

Notable fact
SIMD MonoThread running on a single core beats MultiThread running on 8 cores.
So other threads can still keep running without competing for CPU resources.

MethodMeanAllocated
Arch_MonoThread62.09 μs-
Arch_MonoThread_SourceGenerated52.43 μs-
Arch_MultiThread49.57 μs-
DefaultEcs_MonoThread126.33 μs-
DefaultEcs_MultiThread128.18 μs-
Fennecs_ForEach56.30 μs-
Fennecs_Job69.65 μs-
Fennecs_Raw52.34 μs-
FlecsNet_Each103.26 μs-
FlecsNet_Iter64.23 μs-
FrifloEngineEcs_MonoThread🔥57.62 μs-
FrifloEngineEcs_MultiThread🔥17.17 μs-
FrifloEngineEcs_SIMD_MonoThread🔥11.00 μs-
HypEcs_MonoThread57.57 μs112 B
HypEcs_MultiThread61.94 μs2079 B
LeopotamEcsLite150.11 μs-
LeopotamEcs134.98 μs-
MonoGameExtended467.59 μs161 B
Morpeh_Direct1,590.35 μs3 B
Morpeh_Stash1,023.88 μs3 B
Myriad_SingleThread46.20 μs-
Myriad_MultiThread366.27 μs239938 B
Myriad_SingleThreadChunk61.32 μs-
Myriad_MultiThreadChunk25.31 μs3085 B
Myriad_Enumerable238.59 μs-
Myriad_Delegate73.47 μs-
Myriad_SingleThreadChunk_SIMD22.33 μs-
RelEcs251.30 μs169 B
SveltoECS162.92 μs-
TinyEcs_Each37.09 μs-
TinyEcs_EachJob23.52 μs1552 B

🔥 library of this project