From 5fe863a60c49bc456006f88b3ff65d7fd99acdf8 Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Mon, 29 Apr 2024 16:04:37 +0100 Subject: [PATCH 01/12] - Updated Myriad.ECS to 9.1.0 - Added Vectorised (SIMD) query implementations --- .../Ecs.CSharp.Benchmark.csproj | 2 +- .../SystemWithOneComponent/Myriad.cs | 24 +++++++++++++++++++ .../SystemWithTwoComponents/Myriad.cs | 22 +++++++++++++++++ .../Myriad.cs | 22 +++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj index d7dfa4e..5977868 100644 --- a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj +++ b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj @@ -18,7 +18,7 @@ - + diff --git a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Myriad.cs b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Myriad.cs index a19a3bb..5cf5737 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Myriad.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Myriad.cs @@ -1,4 +1,5 @@ using System; +using System.Numerics; using BenchmarkDotNet.Attributes; using Ecs.CSharp.Benchmark.Contexts; using Ecs.CSharp.Benchmark.Contexts.Myriad_Components; @@ -29,6 +30,20 @@ public void Execute(ReadOnlySpan e, Span t0) } } + private struct MyriadVectorForEach1 + : IVectorChunkQuery1 + { + private static readonly Vector _one = Vector.One; + + public void Execute(Span> t0, int padding) + { + for (int i = 0; i < t0.Length; i++) + { + t0[i] += _one; + } + } + } + private sealed class MyriadContext : MyriadBaseContext { public MyriadContext(int entityCount, int padding) @@ -108,5 +123,14 @@ public void Myriad_Delegate() c.Value++; }); } + + [BenchmarkCategory(Categories.Myriad)] + [Benchmark] + public void Myriad_SingleThreadChunk_SIMD() + { + World world = _myriad.World; + + world.ExecuteVectorChunk(new MyriadVectorForEach1()); + } } } diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/Myriad.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/Myriad.cs index 3debe73..951acdc 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/Myriad.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/Myriad.cs @@ -1,4 +1,5 @@ using System; +using System.Numerics; using BenchmarkDotNet.Attributes; using Ecs.CSharp.Benchmark.Contexts; using Ecs.CSharp.Benchmark.Contexts.Myriad_Components; @@ -29,6 +30,18 @@ public void Execute(ReadOnlySpan e, Span t0, Span + { + public void Execute(Span> t0, Span> t1, int padding) + { + for (int i = 0; i < t0.Length; i++) + { + t0[i] += t1[i]; + } + } + } + private sealed class MyriadContext : MyriadBaseContext { public MyriadContext(int entityCount, int padding) @@ -108,5 +121,14 @@ public void Myriad_Delegate() c1.Value += c2.Value; }); } + + [BenchmarkCategory(Categories.Myriad)] + [Benchmark] + public void Myriad_SingleThreadChunk_SIMD() + { + World world = _myriad.World; + + world.ExecuteVectorChunk(new MyriadVectorForEach2()); + } } } diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Myriad.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Myriad.cs index d50fe00..85fa93a 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Myriad.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Myriad.cs @@ -1,4 +1,5 @@ using System; +using System.Numerics; using BenchmarkDotNet.Attributes; using Ecs.CSharp.Benchmark.Contexts; using Ecs.CSharp.Benchmark.Contexts.Myriad_Components; @@ -29,6 +30,18 @@ public void Execute(ReadOnlySpan e, Span t0, Span + { + public void Execute(Span> t0, Span> t1, int padding) + { + for (int i = 0; i < t0.Length; i++) + { + t0[i] += t1[i]; + } + } + } + private sealed class MyriadContext : MyriadBaseContext { public MyriadContext(int entityCount) @@ -121,5 +134,14 @@ public void Myriad_Delegate() c1.Value += c2.Value; }); } + + [BenchmarkCategory(Categories.Myriad)] + [Benchmark] + public void Myriad_SingleThreadChunk_SIMD() + { + World world = _myriad.World; + + world.ExecuteVectorChunk(new MyriadVectorForEach2()); + } } } From a5f0db554ad923c48747109c2d35b1137b20ca78 Mon Sep 17 00:00:00 2001 From: Xentripetal Date: Sun, 28 Apr 2024 22:33:36 -0500 Subject: [PATCH 02/12] Throwing an exception in the constructor breaks all other tests --- .../SystemWithOneComponent/Myriad.cs | 16 ++++++---------- .../SystemWithThreeComponents/Myriad.cs | 12 ++++-------- .../SystemWithTwoComponents/Myriad.cs | 12 ++++-------- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Myriad.cs b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Myriad.cs index 5cf5737..9ae349b 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Myriad.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Myriad.cs @@ -46,27 +46,23 @@ public void Execute(Span> t0, int padding) private sealed class MyriadContext : MyriadBaseContext { - public MyriadContext(int entityCount, int padding) + // Myriad stores components as arrays of structs, so all structs of the same type are + // always sequential in memory no matter what else is attached to the entity. So no need to respect + // the padding input + public MyriadContext(int entityCount, int _) : base() { CommandBuffer cmd = new CommandBuffer(World); for (int i = 0; i < entityCount; i++) { CommandBuffer.BufferedEntity e = cmd.Create().Set(new Component1()); - - if (padding != 0) - { - // Myriad stores components as arrays of structs, so all structs of the same type are - // always sequential in memory no matter what else is attached to the entity. - throw new NotSupportedException($"Padding makes no difference to Myriad.ECS"); - } } + cmd.Playback().Dispose(); } } - [Context] - private readonly MyriadContext _myriad; + [Context] private readonly MyriadContext _myriad; [BenchmarkCategory(Categories.Myriad)] [Benchmark] diff --git a/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/Myriad.cs b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/Myriad.cs index 12e1a70..5623fa8 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/Myriad.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/Myriad.cs @@ -31,20 +31,16 @@ public void Execute(ReadOnlySpan e, Span t0, Span> t0, Span> t1, int padding) private sealed class MyriadContext : MyriadBaseContext { - public MyriadContext(int entityCount, int padding) + // Myriad stores components as arrays of structs, so all structs of the same type are + // always sequential in memory no matter what else is attached to the entity. So no need to respect + // the padding input + public MyriadContext(int entityCount, int _) : base() { CommandBuffer cmd = new CommandBuffer(World); for (int i = 0; i < entityCount; i++) { CommandBuffer.BufferedEntity e = cmd.Create().Set(new Component1()).Set(new Component2()); - - if (padding != 0) - { - // Myriad stores components as arrays of structs, so all structs of the same type are - // always sequential in memory no matter what else is attached to the entity. - throw new NotSupportedException($"Padding makes no difference to Myriad.ECS"); - } } cmd.Playback().Dispose(); } From f0d7246c0a93131528d49875610f53a125406a8a Mon Sep 17 00:00:00 2001 From: Xentripetal Date: Sun, 28 Apr 2024 22:00:11 -0500 Subject: [PATCH 03/12] Add TinyECS --- README.md | 1 + source/Ecs.CSharp.Benchmark/Categories.cs | 1 + .../Contexts/TinyEcsBaseContext.cs | 24 +++++++ .../CreateEntityWithOneComponent/TinyEcs.cs | 23 +++++++ .../TinyEcs.cs | 26 ++++++++ .../CreateEntityWithTwoComponents/TinyEcs.cs | 25 ++++++++ .../Ecs.CSharp.Benchmark.csproj | 1 + .../SystemWithOneComponent/TinyEcs.cs | 42 ++++++++++++ .../SystemWithThreeComponents/TinyEcs.cs | 59 +++++++++++++++++ .../SystemWithTwoComponents/TinyEcs.cs | 54 ++++++++++++++++ .../TinyEcs.cs | 64 +++++++++++++++++++ 11 files changed, 320 insertions(+) create mode 100644 source/Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs create mode 100644 source/Ecs.CSharp.Benchmark/CreateEntityWithOneComponent/TinyEcs.cs create mode 100644 source/Ecs.CSharp.Benchmark/CreateEntityWithThreeComponents/TinyEcs.cs create mode 100644 source/Ecs.CSharp.Benchmark/CreateEntityWithTwoComponents/TinyEcs.cs create mode 100644 source/Ecs.CSharp.Benchmark/SystemWithOneComponent/TinyEcs.cs create mode 100644 source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/TinyEcs.cs create mode 100644 source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/TinyEcs.cs create mode 100644 source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/TinyEcs.cs diff --git a/README.md b/README.md index ba5bacb..352a1fb 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Tested frameworks: - [Myriad.ECS](https://github.com/martindevans/Myriad.ECS) - [RelEcs](https://github.com/Byteron/RelEcs) - [Svelto.ECS](https://github.com/sebas77/Svelto.ECS) +- [TinyEcs](https://github.com/andreakarasho/TinyEcs) Removed frameworks: - [Entitas](https://github.com/sschmid/Entitas) removed because it was taking forever to initialize in the later tests when moved to net8, you can check older benchmark results [here](https://github.com/Doraku/Ecs.CSharp.Benchmark/tree/3574b2dfb948e941a208f77eaf9e94b73d58e6bf) diff --git a/source/Ecs.CSharp.Benchmark/Categories.cs b/source/Ecs.CSharp.Benchmark/Categories.cs index 8c777af..2e0e883 100644 --- a/source/Ecs.CSharp.Benchmark/Categories.cs +++ b/source/Ecs.CSharp.Benchmark/Categories.cs @@ -15,6 +15,7 @@ internal static class Categories public const string Morpeh = "Morpeh"; public const string FlecsNet = "FlecsNet"; public const string Fennecs = "Fennecs"; + public const string TinyEcs = "TinyEcs"; public const string CreateEntity = "CreateEntity"; public const string System = "System"; diff --git a/source/Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs b/source/Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs new file mode 100644 index 0000000..0247c8a --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs @@ -0,0 +1,24 @@ +using System; +using TinyEcs; + +namespace Ecs.CSharp.Benchmark.Contexts +{ + namespace TinyEcs_Components + { + public record struct Component1(int Value); + + public record struct Component2(int Value); + + public record struct Component3(int Value); + } + + public class TinyEcsBaseContext + { + public World World { get; } + + public TinyEcsBaseContext() + { + World = new World(); + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/CreateEntityWithOneComponent/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/CreateEntityWithOneComponent/TinyEcs.cs new file mode 100644 index 0000000..76e6efa --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/CreateEntityWithOneComponent/TinyEcs.cs @@ -0,0 +1,23 @@ +using BenchmarkDotNet.Attributes; +using DefaultEcs; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.TinyEcs_Components; + +namespace Ecs.CSharp.Benchmark +{ + public partial class CreateEntityWithOneComponent + { + [Context] + private readonly TinyEcsBaseContext _tinyEcs; + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs() + { + for (int i = 0; i < EntityCount; ++i) + { + _tinyEcs.World.Entity().Set(); + } + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/CreateEntityWithThreeComponents/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/CreateEntityWithThreeComponents/TinyEcs.cs new file mode 100644 index 0000000..6960f6c --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/CreateEntityWithThreeComponents/TinyEcs.cs @@ -0,0 +1,26 @@ +using BenchmarkDotNet.Attributes; +using DefaultEcs; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.TinyEcs_Components; + +namespace Ecs.CSharp.Benchmark +{ + public partial class CreateEntityWithThreeComponents + { + [Context] + private readonly TinyEcsBaseContext _tinyEcs; + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs() + { + for (int i = 0; i < EntityCount; ++i) + { + _tinyEcs.World.Entity() + .Set() + .Set() + .Set(); + } + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/CreateEntityWithTwoComponents/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/CreateEntityWithTwoComponents/TinyEcs.cs new file mode 100644 index 0000000..e98377a --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/CreateEntityWithTwoComponents/TinyEcs.cs @@ -0,0 +1,25 @@ +using BenchmarkDotNet.Attributes; +using DefaultEcs; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.TinyEcs_Components; + +namespace Ecs.CSharp.Benchmark +{ + public partial class CreateEntityWithTwoComponents + { + [Context] + private readonly TinyEcsBaseContext _tinyEcs; + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs() + { + for (int i = 0; i < EntityCount; ++i) + { + _tinyEcs.World.Entity() + .Set() + .Set(); + } + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj index 5977868..99aadeb 100644 --- a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj +++ b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj @@ -22,6 +22,7 @@ + diff --git a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/TinyEcs.cs new file mode 100644 index 0000000..55324c4 --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/TinyEcs.cs @@ -0,0 +1,42 @@ +using BenchmarkDotNet.Attributes; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.TinyEcs_Components; +using TinyEcs; + +namespace Ecs.CSharp.Benchmark +{ + public partial class SystemWithOneComponent + { + [Context] private readonly TinyEcsContext _tinyEcs; + + private sealed class TinyEcsContext : TinyEcsBaseContext + { + public TinyEcsContext(int entityCount, int entityPadding) : base() + { + for (int i = 0; i < entityCount; ++i) + { + for (int j = 0; j < entityPadding; ++j) + { + World.Entity(); + } + + World.Entity().Set(); + } + } + } + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs_Each() + { + _tinyEcs.World.Each((EntityView _, ref Component1 c1) => c1.Value++); + } + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs_EachJob() + { + _tinyEcs.World.EachJob((EntityView _, ref Component1 c1) => c1.Value++); + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/TinyEcs.cs new file mode 100644 index 0000000..b00d42d --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/TinyEcs.cs @@ -0,0 +1,59 @@ +using BenchmarkDotNet.Attributes; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.TinyEcs_Components; +using TinyEcs; + +namespace Ecs.CSharp.Benchmark +{ + public partial class SystemWithThreeComponents + { + [Context] private readonly TinyEcsContext _tinyEcs; + + private sealed class TinyEcsContext : TinyEcsBaseContext + { + public TinyEcsContext(int entityCount, int entityPadding) : base() + { + for (int i = 0; i < entityCount; ++i) + { + for (int j = 0; j < entityPadding; ++j) + { + var padding = World.Entity(); + switch (j % 3) + { + case 0: + padding.Set(new Component1()); + break; + + case 1: + padding.Set(new Component2()); + break; + + case 2: + padding.Set(new Component3()); + break; + } + } + + World.Entity() + .Set(new Component1()) + .Set(new Component2 { Value = 1 }) + .Set(new Component3 { Value = 1 }); + } + } + } + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs_Each() + { + _tinyEcs.World.Each((EntityView _, ref Component1 c1, ref Component2 c2, ref Component3 c3) => c1.Value += c2.Value + c3.Value); + } + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs_EachJob() + { + _tinyEcs.World.EachJob((EntityView _, ref Component1 c1, ref Component2 c2, ref Component3 c3) => c1.Value += c2.Value + c3.Value); + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/TinyEcs.cs new file mode 100644 index 0000000..c8116d9 --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/TinyEcs.cs @@ -0,0 +1,54 @@ +using BenchmarkDotNet.Attributes; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.TinyEcs_Components; +using TinyEcs; + +namespace Ecs.CSharp.Benchmark +{ + public partial class SystemWithTwoComponents + { + [Context] private readonly TinyEcsContext _tinyEcs; + + private sealed class TinyEcsContext : TinyEcsBaseContext + { + public TinyEcsContext(int entityCount, int entityPadding) : base() + { + for (int i = 0; i < entityCount; ++i) + { + for (int j = 0; j < entityPadding; ++j) + { + var padding = World.Entity(); + switch (j % 2) + { + case 0: + padding.Set(new Component1()); + break; + + case 1: + padding.Set(new Component2()); + break; + } + } + + World.Entity() + .Set(new Component1()) + .Set(new Component2 { Value = 1 }); + } + } + } + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs_Each() + { + _tinyEcs.World.Each((EntityView _, ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); + } + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs_EachJob() + { + _tinyEcs.World.EachJob((EntityView _, ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/TinyEcs.cs new file mode 100644 index 0000000..1919eb6 --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/TinyEcs.cs @@ -0,0 +1,64 @@ +using BenchmarkDotNet.Attributes; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.TinyEcs_Components; +using TinyEcs; + +namespace Ecs.CSharp.Benchmark +{ + public partial class SystemWithTwoComponentsMultipleComposition + { + [Context] private readonly TinyEcsContext _tinyEcs; + + private sealed class TinyEcsContext : TinyEcsBaseContext + { + + private record struct Padding1(); + private record struct Padding2(); + private record struct Padding3(); + private record struct Padding4(); + + public TinyEcsContext(int entityCount) : base() + { + for (int i = 0; i < entityCount; ++i) + { + var entity = World.Entity(); + entity.Set(); + entity.Set(new Component2 { Value = 1 }); + + switch (i % 4) + { + case 0: + entity.Set(); + break; + + case 1: + entity.Set(); + break; + + case 2: + entity.Set(); + break; + + case 3: + entity.Set(); + break; + } + } + } + } + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs_Each() + { + _tinyEcs.World.Each((EntityView _, ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); + } + + [BenchmarkCategory(Categories.TinyEcs)] + [Benchmark] + public void TinyEcs_EachJob() + { + _tinyEcs.World.EachJob((EntityView _, ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); + } + } +} From af2fa6b6b12cb85947275e378d05de56e2193349 Mon Sep 17 00:00:00 2001 From: Lars Date: Fri, 19 Apr 2024 14:38:44 +0200 Subject: [PATCH 04/12] Updated Arch and added source generator. --- .../Contexts/ArchBaseContext.cs | 12 +++++++-- .../Ecs.CSharp.Benchmark.csproj | 4 ++- .../SystemWithOneComponent/Arch.cs | 16 +++++++++++- .../SystemWithThreeComponents/Arch.cs | 16 +++++++++++- .../SystemWithTwoComponents/Arch.cs | 16 +++++++++++- .../Arch.cs | 26 +++++++++++++++++-- 6 files changed, 82 insertions(+), 8 deletions(-) diff --git a/source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs b/source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs index a0dacde..29f7c57 100644 --- a/source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs +++ b/source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs @@ -1,6 +1,7 @@ using System; using Arch.Core; using Arch.Core.Utils; +using Schedulers; namespace Ecs.CSharp.Benchmark.Contexts { @@ -25,7 +26,7 @@ internal struct Component3 internal class ArchBaseContext : IDisposable { public World World { get; } - public JobScheduler.JobScheduler JobScheduler { get; set; } + public JobScheduler JobScheduler { get; set; } public ArchBaseContext() { @@ -34,7 +35,14 @@ public ArchBaseContext() public ArchBaseContext(ComponentType[] archetype, int amount) { - JobScheduler = new JobScheduler.JobScheduler("Arch"); + JobScheduler = new JobScheduler(new JobScheduler.Config + { + ThreadPrefixName = "Arch.Samples", + ThreadCount = 0, + MaxExpectedConcurrentJobs = 64, + StrictAllocationMode = false, + }); + World = World.Create(); World.Reserve(archetype, amount); diff --git a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj index 99aadeb..e929f49 100644 --- a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj +++ b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj @@ -17,6 +17,8 @@ + + @@ -30,7 +32,7 @@ - + diff --git a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Arch.cs b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Arch.cs index 0888f4d..250648b 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Arch.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/Arch.cs @@ -2,6 +2,7 @@ using System.Runtime.CompilerServices; using Arch.Core; using Arch.Core.Utils; +using Arch.System; using BenchmarkDotNet.Attributes; using Ecs.CSharp.Benchmark.Contexts; using Ecs.CSharp.Benchmark.Contexts.Arch_Components; @@ -19,6 +20,12 @@ public void Update(ref Component1 t0) } } + [Query] + private static void ForEach(ref Component1 t0) + { + ++t0.Value; + } + private sealed class ArchContext : ArchBaseContext { public ArchContext(int entityCount, int _) @@ -31,7 +38,6 @@ public ArchContext(int entityCount, int _) [Context] private readonly ArchContext _arch; - private ForEach1 _forEach; [BenchmarkCategory(Categories.Arch)] @@ -41,6 +47,14 @@ public void Arch_MonoThread() World world = _arch.World; world.InlineQuery(_queryDescription, ref _forEach); } + + [BenchmarkCategory(Categories.Arch)] + [Benchmark] + public void Arch_MonoThread_SourceGenerated() + { + ForEachQuery(_arch.World); + } + [BenchmarkCategory(Categories.Arch)] [Benchmark] public void Arch_MultiThread() diff --git a/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/Arch.cs b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/Arch.cs index 0ff6319..7056e4e 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/Arch.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/Arch.cs @@ -2,6 +2,7 @@ using System.Runtime.CompilerServices; using Arch.Core; using Arch.Core.Utils; +using Arch.System; using BenchmarkDotNet.Attributes; using Ecs.CSharp.Benchmark.Contexts; using Ecs.CSharp.Benchmark.Contexts.Arch_Components; @@ -19,6 +20,12 @@ public void Update(ref Component1 t0, ref Component2 t1, ref Component3 t2) } } + [Query] + private static void ForEach(ref Component1 t0, Component2 t1, Component3 t2) + { + t0.Value += t1.Value + t2.Value; + } + private sealed class ArchContext : ArchBaseContext { public ArchContext(int entityCount, int _) @@ -31,7 +38,6 @@ public ArchContext(int entityCount, int _) [Context] private readonly ArchContext _arch; - private ForEach3 _forEach3; [BenchmarkCategory(Categories.Arch)] @@ -41,6 +47,14 @@ public void Arch_MonoThread() World world = _arch.World; world.InlineQuery(_queryDescription, ref _forEach3); } + + [BenchmarkCategory(Categories.Arch)] + [Benchmark] + public void Arch_MonoThread_SourceGenerated() + { + ForEachQuery(_arch.World); + } + [BenchmarkCategory(Categories.Arch)] [Benchmark] public void Arch_MultiThread() diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/Arch.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/Arch.cs index 9156239..0d4e43b 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/Arch.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/Arch.cs @@ -2,6 +2,7 @@ using System.Runtime.CompilerServices; using Arch.Core; using Arch.Core.Utils; +using Arch.System; using BenchmarkDotNet.Attributes; using Ecs.CSharp.Benchmark.Contexts; using Ecs.CSharp.Benchmark.Contexts.Arch_Components; @@ -18,6 +19,12 @@ public void Update(ref Component1 t0, ref Component2 t1) t0.Value += t1.Value; } } + + [Query] + private static void ForEach(ref Component1 t0, Component2 t1) + { + t0.Value += t1.Value; + } private sealed class ArchContext : ArchBaseContext { @@ -31,7 +38,6 @@ public ArchContext(int entityCount, int _) [Context] private readonly ArchContext _arch; - private ForEach2 _forEach2; [BenchmarkCategory(Categories.Arch)] @@ -41,6 +47,14 @@ public void Arch_MonoThread() World world = _arch.World; world.InlineQuery(in _queryDescription, ref _forEach2); } + + [BenchmarkCategory(Categories.Arch)] + [Benchmark] + public void Arch_MonoThread_SourceGenerated() + { + ForEachQuery(_arch.World); + } + [BenchmarkCategory(Categories.Arch)] [Benchmark] public void Arch_MultiThread() diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Arch.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Arch.cs index e0fb2b5..c673c72 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Arch.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Arch.cs @@ -3,9 +3,11 @@ using System.Runtime.CompilerServices; using Arch.Core; using Arch.Core.Utils; +using Arch.System; using BenchmarkDotNet.Attributes; using Ecs.CSharp.Benchmark.Contexts; using Ecs.CSharp.Benchmark.Contexts.Arch_Components; +using Schedulers; namespace Ecs.CSharp.Benchmark { @@ -19,6 +21,12 @@ public void Update(ref Component1 t0, ref Component2 t1) t0.Value += t1.Value; } } + + [Query] + private static void ForEach(ref Component1 t0, Component2 t1) + { + t0.Value += t1.Value; + } private sealed class ArchContext : ArchBaseContext { @@ -32,7 +40,14 @@ private record struct Padding4(); public ArchContext(int entityCount) { - JobScheduler = new JobScheduler.JobScheduler("Arch"); + JobScheduler = new JobScheduler( new JobScheduler.Config + { + ThreadPrefixName = "Arch.Benchmark", + ThreadCount = 0, + MaxExpectedConcurrentJobs = 64, + StrictAllocationMode = false, + }); + ComponentType[] paddingTypes = [ typeof(Padding1), typeof(Padding2), @@ -59,7 +74,6 @@ public ArchContext(int entityCount) [Context] private readonly ArchContext _arch; - private ForEach2 _forEach2; [BenchmarkCategory(Categories.Arch)] @@ -69,6 +83,14 @@ public void Arch() World world = _arch.World; world.InlineQuery(in _queryDescription, ref _forEach2); } + + [BenchmarkCategory(Categories.Arch)] + [Benchmark] + public void Arch_MonoThread_SourceGenerated() + { + ForEachQuery(_arch.World); + } + [BenchmarkCategory(Categories.Arch)] [Benchmark] public void Arch_MultiThread() From ef47955e8a3799521380067b1abec6e65e472d79 Mon Sep 17 00:00:00 2001 From: Lars Date: Fri, 19 Apr 2024 15:42:59 +0200 Subject: [PATCH 05/12] Made JobScheduler work. --- source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs | 1 + .../SystemWithTwoComponentsMultipleComposition/Arch.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs b/source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs index 29f7c57..7db5b3e 100644 --- a/source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs +++ b/source/Ecs.CSharp.Benchmark/Contexts/ArchBaseContext.cs @@ -44,6 +44,7 @@ public ArchBaseContext(ComponentType[] archetype, int amount) }); World = World.Create(); + World.SharedJobScheduler = JobScheduler; World.Reserve(archetype, amount); for (int index = 0; index < amount; index++) diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Arch.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Arch.cs index c673c72..69c650b 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Arch.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/Arch.cs @@ -47,6 +47,7 @@ public ArchContext(int entityCount) MaxExpectedConcurrentJobs = 64, StrictAllocationMode = false, }); + World.SharedJobScheduler = JobScheduler; ComponentType[] paddingTypes = [ typeof(Padding1), From 1a9a2c74d7c4e2cc04825d0c8c8150dad78d9937 Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 29 Apr 2024 22:37:58 +0200 Subject: [PATCH 06/12] Updated archs sourcegenerator. --- source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj index e929f49..c146ba4 100644 --- a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj +++ b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj @@ -18,7 +18,7 @@ - + From 441099624b9cb203cc9ac3a8a7eacffba6c3bd10 Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 29 Apr 2024 22:58:40 +0200 Subject: [PATCH 07/12] Next version. --- source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj index c146ba4..f090c17 100644 --- a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj +++ b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj @@ -18,7 +18,7 @@ - + From 83129c9da11e8b54e2ab416e99cf9ead79a789ac Mon Sep 17 00:00:00 2001 From: Xentripetal Date: Tue, 30 Apr 2024 18:57:21 -0500 Subject: [PATCH 08/12] Adjusts TinyEcs tests to match creators recommendations --- .../Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs | 7 ++++++- .../SystemWithOneComponent/TinyEcs.cs | 7 +++++-- .../SystemWithThreeComponents/TinyEcs.cs | 8 ++++++-- .../SystemWithTwoComponents/TinyEcs.cs | 7 +++++-- .../SystemWithTwoComponentsMultipleComposition/TinyEcs.cs | 8 ++++++-- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/source/Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs b/source/Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs index 0247c8a..e8034f7 100644 --- a/source/Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs +++ b/source/Ecs.CSharp.Benchmark/Contexts/TinyEcsBaseContext.cs @@ -12,7 +12,7 @@ public record struct Component2(int Value); public record struct Component3(int Value); } - public class TinyEcsBaseContext + internal class TinyEcsBaseContext : IDisposable { public World World { get; } @@ -20,5 +20,10 @@ public TinyEcsBaseContext() { World = new World(); } + + public virtual void Dispose() + { + World?.Dispose(); + } } } diff --git a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/TinyEcs.cs index 55324c4..6b57b4e 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/TinyEcs.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/TinyEcs.cs @@ -11,6 +11,7 @@ public partial class SystemWithOneComponent private sealed class TinyEcsContext : TinyEcsBaseContext { + public Query Query { get; } public TinyEcsContext(int entityCount, int entityPadding) : base() { for (int i = 0; i < entityCount; ++i) @@ -22,6 +23,8 @@ public TinyEcsContext(int entityCount, int entityPadding) : base() World.Entity().Set(); } + + Query = World.Query(); } } @@ -29,14 +32,14 @@ public TinyEcsContext(int entityCount, int entityPadding) : base() [Benchmark] public void TinyEcs_Each() { - _tinyEcs.World.Each((EntityView _, ref Component1 c1) => c1.Value++); + _tinyEcs.Query.Each((ref Component1 c1) => c1.Value++); } [BenchmarkCategory(Categories.TinyEcs)] [Benchmark] public void TinyEcs_EachJob() { - _tinyEcs.World.EachJob((EntityView _, ref Component1 c1) => c1.Value++); + _tinyEcs.Query.EachJob((ref Component1 c1) => c1.Value++); } } } diff --git a/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/TinyEcs.cs index b00d42d..ca25214 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/TinyEcs.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/TinyEcs.cs @@ -11,6 +11,8 @@ public partial class SystemWithThreeComponents private sealed class TinyEcsContext : TinyEcsBaseContext { + public Query Query { get; } + public TinyEcsContext(int entityCount, int entityPadding) : base() { for (int i = 0; i < entityCount; ++i) @@ -38,6 +40,8 @@ public TinyEcsContext(int entityCount, int entityPadding) : base() .Set(new Component1()) .Set(new Component2 { Value = 1 }) .Set(new Component3 { Value = 1 }); + + Query = World.QueryBuilder().With().With().With().Build(); } } } @@ -46,14 +50,14 @@ public TinyEcsContext(int entityCount, int entityPadding) : base() [Benchmark] public void TinyEcs_Each() { - _tinyEcs.World.Each((EntityView _, ref Component1 c1, ref Component2 c2, ref Component3 c3) => c1.Value += c2.Value + c3.Value); + _tinyEcs.Query.Each((ref Component1 c1, ref Component2 c2, ref Component3 c3) => c1.Value += c2.Value + c3.Value); } [BenchmarkCategory(Categories.TinyEcs)] [Benchmark] public void TinyEcs_EachJob() { - _tinyEcs.World.EachJob((EntityView _, ref Component1 c1, ref Component2 c2, ref Component3 c3) => c1.Value += c2.Value + c3.Value); + _tinyEcs.Query.EachJob((ref Component1 c1, ref Component2 c2, ref Component3 c3) => c1.Value += c2.Value + c3.Value); } } } diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/TinyEcs.cs index c8116d9..e76a03b 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/TinyEcs.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/TinyEcs.cs @@ -11,6 +11,8 @@ public partial class SystemWithTwoComponents private sealed class TinyEcsContext : TinyEcsBaseContext { + public Query Query { get; } + public TinyEcsContext(int entityCount, int entityPadding) : base() { for (int i = 0; i < entityCount; ++i) @@ -33,6 +35,7 @@ public TinyEcsContext(int entityCount, int entityPadding) : base() World.Entity() .Set(new Component1()) .Set(new Component2 { Value = 1 }); + Query = World.QueryBuilder().With().With().Build(); } } } @@ -41,14 +44,14 @@ public TinyEcsContext(int entityCount, int entityPadding) : base() [Benchmark] public void TinyEcs_Each() { - _tinyEcs.World.Each((EntityView _, ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); + _tinyEcs.Query.Each((ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); } [BenchmarkCategory(Categories.TinyEcs)] [Benchmark] public void TinyEcs_EachJob() { - _tinyEcs.World.EachJob((EntityView _, ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); + _tinyEcs.Query.EachJob((ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); } } } diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/TinyEcs.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/TinyEcs.cs index 1919eb6..8ab7a6f 100644 --- a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/TinyEcs.cs +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/TinyEcs.cs @@ -16,6 +16,8 @@ private record struct Padding1(); private record struct Padding2(); private record struct Padding3(); private record struct Padding4(); + public Query Query { get; } + public TinyEcsContext(int entityCount) : base() { @@ -44,6 +46,8 @@ public TinyEcsContext(int entityCount) : base() break; } } + + Query = World.QueryBuilder().With().With().Build(); } } @@ -51,14 +55,14 @@ public TinyEcsContext(int entityCount) : base() [Benchmark] public void TinyEcs_Each() { - _tinyEcs.World.Each((EntityView _, ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); + _tinyEcs.Query.Each((ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); } [BenchmarkCategory(Categories.TinyEcs)] [Benchmark] public void TinyEcs_EachJob() { - _tinyEcs.World.EachJob((EntityView _, ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); + _tinyEcs.Query.EachJob((ref Component1 c1, ref Component2 c2) => c1.Value += c2.Value); } } } From 380ea2bb71cbcfdefc74b6b0f9279099d37ca66b Mon Sep 17 00:00:00 2001 From: Xentripetal Date: Thu, 2 May 2024 22:17:51 -0500 Subject: [PATCH 09/12] Finish out flecs benchmarks --- .../Contexts/FlecsNetBaseContext.cs | 2 +- .../Ecs.CSharp.Benchmark.csproj | 2 +- .../SystemWithOneComponent/FlecsNet.cs | 56 ++++++++++++++ .../SystemWithThreeComponents/FlecsNet.cs | 77 +++++++++++++++++++ .../SystemWithTwoComponents/FlecsNet.cs | 69 +++++++++++++++++ .../FlecsNet.cs | 75 ++++++++++++++++++ 6 files changed, 279 insertions(+), 2 deletions(-) create mode 100644 source/Ecs.CSharp.Benchmark/SystemWithOneComponent/FlecsNet.cs create mode 100644 source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/FlecsNet.cs create mode 100644 source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/FlecsNet.cs create mode 100644 source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/FlecsNet.cs diff --git a/source/Ecs.CSharp.Benchmark/Contexts/FlecsNetBaseContext.cs b/source/Ecs.CSharp.Benchmark/Contexts/FlecsNetBaseContext.cs index 32888b2..34838fd 100644 --- a/source/Ecs.CSharp.Benchmark/Contexts/FlecsNetBaseContext.cs +++ b/source/Ecs.CSharp.Benchmark/Contexts/FlecsNetBaseContext.cs @@ -21,7 +21,7 @@ internal struct Component3 } } - internal sealed class FlecsNetBaseContext : IDisposable + internal class FlecsNetBaseContext : IDisposable { public World World { get; } diff --git a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj index f090c17..5c24029 100644 --- a/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj +++ b/source/Ecs.CSharp.Benchmark/Ecs.CSharp.Benchmark.csproj @@ -56,7 +56,7 @@ - + \ No newline at end of file diff --git a/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/FlecsNet.cs b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/FlecsNet.cs new file mode 100644 index 0000000..5ca3aff --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/SystemWithOneComponent/FlecsNet.cs @@ -0,0 +1,56 @@ +using BenchmarkDotNet.Attributes; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.Arch_Components; +using Flecs.NET.Core; + +namespace Ecs.CSharp.Benchmark +{ + public partial class SystemWithOneComponent + { + [Context] + private readonly FlecsContext _flecs; + + private sealed class FlecsContext : FlecsNetBaseContext + { + public Query query; + + public FlecsContext(int entityCount, int entityPadding) + { + for (int i = 0; i < entityCount; ++i) + { + for (int j = 0; j < entityPadding; ++j) + { + World.Entity(); + } + + World.Entity().Add(); + + } + query = World.QueryBuilder().With().Build(); + } + } + + [BenchmarkCategory(Categories.FlecsNet)] + [Benchmark] + public void FlecsNet_Each() + { + _flecs.query.Each((ref Component1 c1) => + { + c1.Value += 1; + }); + } + + [BenchmarkCategory(Categories.FlecsNet)] + [Benchmark] + public void FlecsNet_Iter() + { + _flecs.query.Iter((Iter it, Column c1) => + { + foreach (int i in it) + { + c1[i].Value += 1; + } + }); + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/FlecsNet.cs b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/FlecsNet.cs new file mode 100644 index 0000000..a74db45 --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/SystemWithThreeComponents/FlecsNet.cs @@ -0,0 +1,77 @@ +using BenchmarkDotNet.Attributes; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.Arch_Components; +using Flecs.NET.Core; + +namespace Ecs.CSharp.Benchmark +{ + public partial class SystemWithThreeComponents + { + [Context] + private readonly FlecsContext _flecs; + + private sealed class FlecsContext : FlecsNetBaseContext + { + public Query query; + + public FlecsContext(int entityCount, int entityPadding) + { + for (int i = 0; i < entityCount; ++i) + { + for (int j = 0; j < entityPadding; ++j) + { + Entity padding = World.Entity(); + switch (j % 3) + { + case 0: + padding.Add(); + break; + + case 1: + padding.Add(); + break; + + case 2: + padding.Add(); + break; + } + } + + World.Entity().Add() + .Set(new Component2 + { + Value = 1 + }) + .Set(new Component3 + { + Value = 1 + }); + } + query = World.QueryBuilder().With().With().With().Build(); + } + } + + [BenchmarkCategory(Categories.FlecsNet)] + [Benchmark] + public void FlecsNet_Each() + { + _flecs.query.Each((ref Component1 c1, ref Component2 c2, ref Component3 c3) => + { + c1.Value += c2.Value + c3.Value; + }); + } + + [BenchmarkCategory(Categories.FlecsNet)] + [Benchmark] + public void FlecsNet_Iter() + { + _flecs.query.Iter((Iter it, Column c1, Column c2, Column c3) => + { + foreach (int i in it) + { + c1[i].Value += c2[i].Value + c3[i].Value; + } + }); + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/FlecsNet.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/FlecsNet.cs new file mode 100644 index 0000000..60fec55 --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponents/FlecsNet.cs @@ -0,0 +1,69 @@ +using BenchmarkDotNet.Attributes; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.Arch_Components; +using Flecs.NET.Core; + +namespace Ecs.CSharp.Benchmark +{ + public partial class SystemWithTwoComponents + { + [Context] + private readonly FlecsContext _flecs; + + private sealed class FlecsContext : FlecsNetBaseContext + { + public Query query; + + public FlecsContext(int entityCount, int entityPadding) + { + for (int i = 0; i < entityCount; ++i) + { + for (int j = 0; j < entityPadding; ++j) + { + Entity padding = World.Entity(); + switch (j % 2) + { + case 0: + padding.Add(); + break; + + case 1: + padding.Add(); + break; + } + } + + World.Entity().Add() + .Set(new Component2 + { + Value = 1 + }); + } + query = World.QueryBuilder().With().With().Build(); + } + } + + [BenchmarkCategory(Categories.FlecsNet)] + [Benchmark] + public void FlecsNet_Each() + { + _flecs.query.Each((ref Component1 c1, ref Component2 c2) => + { + c1.Value += c2.Value; + }); + } + + [BenchmarkCategory(Categories.FlecsNet)] + [Benchmark] + public void FlecsNet_Iter() + { + _flecs.query.Iter((Iter it, Column c1, Column c2) => + { + foreach (int i in it) + { + c1[i].Value += c2[i].Value; + } + }); + } + } +} diff --git a/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/FlecsNet.cs b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/FlecsNet.cs new file mode 100644 index 0000000..9402dcb --- /dev/null +++ b/source/Ecs.CSharp.Benchmark/SystemWithTwoComponentsMultipleComposition/FlecsNet.cs @@ -0,0 +1,75 @@ +using BenchmarkDotNet.Attributes; +using Ecs.CSharp.Benchmark.Contexts; +using Ecs.CSharp.Benchmark.Contexts.Arch_Components; +using Flecs.NET.Core; + +namespace Ecs.CSharp.Benchmark +{ + public partial class SystemWithTwoComponentsMultipleComposition + { + [Context] + private readonly FlecsContext _flecs; + + + private sealed class FlecsContext : FlecsNetBaseContext + { + + private record struct Padding1(); + + private record struct Padding2(); + + private record struct Padding3(); + + private record struct Padding4(); + + public Query query; + + public FlecsContext(int entityCount) + { + for (int i = 0; i < entityCount; ++i) + { + Entity entity = World.Entity().Add().Set(new Component2 { Value = 1 }); + switch (i % 4) + { + case 0: + entity.Add(); + break; + case 1: + entity.Add(); + break; + case 2: + entity.Add(); + break; + case 3: + entity.Add(); + break; + } + } + query = World.QueryBuilder().With().With().Build(); + } + } + + [BenchmarkCategory(Categories.FlecsNet)] + [Benchmark] + public void FlecsNet_Each() + { + _flecs.query.Each((ref Component1 c1, ref Component2 c2) => + { + c1.Value += c2.Value; + }); + } + + [BenchmarkCategory(Categories.FlecsNet)] + [Benchmark] + public void FlecsNet_Iter() + { + _flecs.query.Iter((Iter it, Column c1, Column c2) => + { + foreach (int i in it) + { + c1[i].Value += c2[i].Value; + } + }); + } + } +} From da562524436b1e45ba28f5efb03b8d737da113c2 Mon Sep 17 00:00:00 2001 From: Xentripetal Date: Fri, 3 May 2024 17:48:23 -0500 Subject: [PATCH 10/12] Updated full run and readme --- README.md | 387 ++++++++++-------- ...ateEntityWithOneComponent-report-github.md | 40 +- ...EntityWithThreeComponents-report-github.md | 40 +- ...teEntityWithTwoComponents-report-github.md | 40 +- ...rk.SystemWithOneComponent-report-github.md | 115 ++++-- ...SystemWithThreeComponents-report-github.md | 105 +++-- ...k.SystemWithTwoComponents-report-github.md | 107 +++-- ...onentsMultipleComposition-report-github.md | 60 ++- 8 files changed, 539 insertions(+), 355 deletions(-) diff --git a/README.md b/README.md index 352a1fb..ed39375 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,15 @@ All results are obtained from the same toaster, with the same load, so compariso Tested frameworks: - [Arch](https://github.com/genaray/Arch) - [DefaultEcs](https://github.com/Doraku/DefaultEcs) +- [Fennecs](https://github.com/thygrrr/fennecs) +- [Flecs.Net](https://github.com/BeanCheeseBurrito/Flecs.NET) - [Friflo.Engine.ECS](https://github.com/friflo/Friflo.Json.Fliox/blob/main/Engine/README.md) -- [HypEcs](https://github.com/Byteron/HypEcs) - [Leopotam.Ecs](https://github.com/Leopotam/ecs) using what I believe is a nuget package not made by the actual author and compiled in debug... - [Leopotam.EcsLite](https://github.com/Leopotam/ecslite) using what I believe is a nuget package not made by the actual author and compiled in debug... - [MonoGame.Extended](https://github.com/craftworkgames/MonoGame.Extended) - [Morpeh](https://github.com/scellecs/morpeh) - [Myriad.ECS](https://github.com/martindevans/Myriad.ECS) +- [HypEcs](https://github.com/Byteron/HypEcs) - [RelEcs](https://github.com/Byteron/RelEcs) - [Svelto.ECS](https://github.com/sebas77/Svelto.ECS) - [TinyEcs](https://github.com/andreakarasho/TinyEcs) @@ -27,191 +29,254 @@ Tested versions may not be latest available, that's because I'm lazy and new ver ## [CreateEntityWithOneComponent](results/Ecs.CSharp.Benchmark.CreateEntityWithOneComponent-report-github.md) Create entities with one component. -| Method | Mean | CacheMisses/Op | Allocated | -|----------------- |----------:|---------------:|------------:| -| Arch | 18.022 ms | 78,889 | 9725.83 KB | -| DefaultEcs | 8.520 ms | 105,229 | 11324.68 KB | -| FrifloEngineEcs | 3.467 ms | 45,714 | 5724.16 KB | -| HypEcs | 15.946 ms | 238,660 | 25825.74 KB | -| LeopotamEcs | 20.304 ms | 257,024 | 13684.03 KB | -| LeopotamEcsLite | 11.568 ms | 100,489 | 8170.31 KB | -| MonoGameExtended | 28.082 ms | 254,089 | 16412.13 KB | -| Morpeh_Direct | 13.625 ms | 133,698 | 12481.63 KB | -| Morpeh_Stash | 13.183 ms | 132,164 | 12481.63 KB | -| RelEcs | 43.917 ms | 744,480 | 29705.35 KB | -| SveltoECS | 36.594 ms | 751,995 | 1.25 KB | + +| Method | Mean | StdDev | Allocated | +|----------------- |----------:|----------:|------------:| +| Arch | 7.039 ms | 0.0645 ms | 3178.16 KB | +| DefaultEcs | 11.389 ms | 0.1834 ms | 11321.11 KB | +| Fennecs | 10.429 ms | 0.3498 ms | 13636.45 KB | +| FlecsNet | 6.431 ms | 0.1844 ms | 2.73 KB | +| FrifloEngineEcs | 2.837 ms | 0.3247 ms | 5722.08 KB | +| LeopotamEcsLite | 3.608 ms | 0.2956 ms | 7151.08 KB | +| LeopotamEcs | 6.285 ms | 0.5788 ms | 13685.65 KB | +| MonoGameExtended | 8.255 ms | 1.5408 ms | 16408.89 KB | +| Morpeh_Direct | 58.202 ms | 8.1945 ms | 41305.76 KB | +| Morpeh_Stash | 45.100 ms | 4.1339 ms | 41305.76 KB | +| Myriad | 10.845 ms | 0.2996 ms | 6914.67 KB | +| HypEcs | 9.897 ms | 0.4462 ms | 25827.05 KB | +| RelEcs | 14.758 ms | 0.6834 ms | 29706.66 KB | +| SveltoECS | 21.747 ms | 1.0680 ms | 3.22 KB | +| TinyEcs | 7.454 ms | 0.1306 ms | 7834.44 KB | ## [CreateEntityWithTwoComponents](results/Ecs.CSharp.Benchmark.CreateEntityWithTwoComponents-report-github.md) Create entities with two components. -| Method | Mean | CacheMisses/Op | Allocated | -|----------------- |----------:|---------------:|------------:| -| Arch | 11.17 ms | 64,717 | 9891.36 KB | -| DefaultEcs | 13.93 ms | 167,855 | 15417.46 KB | -| FrifloEngineEcs | 3.40 ms | 43,128 | 6236.16 KB | -| HypEcs | 31.64 ms | 348,540 | 45333.08 KB | -| LeopotamEcs | 18.57 ms | 261,029 | 14709.41 KB | -| LeopotamEcsLite | 18.97 ms | 114,688 | 10219.18 KB | -| MonoGameExtended | 46.98 ms | 578,387 | 23372.71 KB | -| Morpeh_Direct | 68.96 ms | 688,518 | 42308.41 KB | -| Morpeh_Stash | 24.12 ms | 202,301 | 19310.76 KB | -| RelEcs | 102.98 ms | 1,332,887 | 50755.08 KB | -| SveltoECS | 58.31 ms | 1,274,636 | 2.17 KB | +| Method | Mean | StdDev | Allocated | +|----------------- |-----------:|----------:|-------------:| +| Arch | 6.840 ms | 0.0855 ms | 3558.44 KB | +| DefaultEcs | 8.515 ms | 0.2086 ms | 15418.9 KB | +| Fennecs | 15.376 ms | 0.1575 ms | 15174.45 KB | +| FlecsNet | 11.082 ms | 0.0947 ms | 3.11 KB | +| FrifloEngineEcs | 2.522 ms | 0.1804 ms | 6236.16 KB | +| HypEcs | 18.703 ms | 0.3473 ms | 45334.39 KB | +| LeopotamEcsLite | 5.162 ms | 0.3004 ms | 9199.61 KB | +| LeopotamEcs | 6.982 ms | 0.4454 ms | 14711.02 KB | +| MonoGameExtended | 13.274 ms | 0.6977 ms | 23373.84 KB | +| Morpeh_Direct | 239.144 ms | 4.4908 ms | 128867.66 KB | +| Morpeh_Stash | 39.734 ms | 2.4779 ms | 48133.7 KB | +| Myriad | 15.280 ms | 0.1624 ms | 7309.77 KB | +| RelEcs | 36.776 ms | 0.6916 ms | 50749.86 KB | +| SveltoECS | 34.237 ms | 0.6508 ms | 4.14 KB | +| TinyEcs | 14.042 ms | 0.1360 ms | 13785.08 KB | + ## [CreateEntityWithThreeComponents](results/Ecs.CSharp.Benchmark.CreateEntityWithThreeComponents-report-github.md) Create entities with three components. -| Method | Mean | CacheMisses/Op | Allocated | -|----------------- |----------:|---------------:|------------:| -| Arch | 12.87 ms | 65,081 | 10381.21 KB | -| DefaultEcs | 17.90 ms | 226,834 | 19515.29 KB | -| FrifloEngineEcs | 3.421 ms | 42,792 | 6758.40 KB | -| HypEcs | 50.00 ms | 513,928 | 68747.41 KB | -| LeopotamEcs | 28.95 ms | 249,774 | 15734.71 KB | -| LeopotamEcsLite | 26.25 ms | 150,733 | 12268.14 KB | -| MonoGameExtended | 57.80 ms | 1,216,620 | 30152.63 KB | -| Morpeh_Direct | 34.79 ms | 304,068 | 26114.95 KB | -| Morpeh_Stash | 16.57 ms | 151,006 | 15896.18 KB | -| RelEcs | 129.63 ms | 1,929,645 | 75704.51 KB | -| SveltoECS | 78.32 ms | 1,592,638 | 2.67 KB | +| Method | Mean | StdDev | Allocated | +|----------------- |-----------:|----------:|------------:| +| Arch | 3.316 ms | 0.0901 ms | 3947.67 KB | +| SveltoECS | 46.643 ms | 2.0437 ms | 4.64 KB | +| DefaultEcs | 10.885 ms | 0.4542 ms | 19516.68 KB | +| Fennecs | 24.621 ms | 0.2685 ms | 16713.12 KB | +| FlecsNet | 16.746 ms | 0.2291 ms | 3.48 KB | +| FrifloEngineEcs | 2.525 ms | 0.1481 ms | 6750.23 KB | +| HypEcs | 30.509 ms | 0.8438 ms | 68750.7 KB | +| LeopotamEcsLite | 5.995 ms | 0.5505 ms | 11248.14 KB | +| LeopotamEcs | 8.869 ms | 0.5571 ms | 15736.4 KB | +| MonoGameExtended | 21.133 ms | 0.9090 ms | 30154.05 KB | +| Morpeh_Direct | 147.879 ms | 2.6211 ms | 83802.09 KB | +| Morpeh_Stash | 52.206 ms | 1.7453 ms | 44724.3 KB | +| Myriad | 22.632 ms | 0.1896 ms | 7704.88 KB | +| RelEcs | 65.055 ms | 1.1498 ms | 75699.76 KB | +| TinyEcs | 23.599 ms | 0.1396 ms | 21314.25 KB | + ## [SystemWithOneComponent](results/Ecs.CSharp.Benchmark.SystemWithOneComponent-report-github.md) Modify entities with one component. The padding aims to simulate real situation when processed entities and their components are not sequential. -| Method | EntityPadding | Mean | CacheMisses/Op | Allocated | -|--------------------------------------- |-------------- |------------:|---------------:|----------:| -| Arch_MonoThread | 0 | 61.77 μs | 2 | - | -| Arch_MultiThread | 0 | 29.30 μs | 1 | - | -| DefaultEcs_ComponentSystem_MonoThread | 0 | 56.25 μs | 1 | - | -| DefaultEcs_ComponentSystem_MultiThread | 0 | 15.21 μs | 1 | - | -| DefaultEcs_EntitySetSystem_MonoThread | 0 | 118.02 μs | 3 | - | -| DefaultEcs_EntitySetSystem_MultiThread | 0 | 31.55 μs | 3 | - | -| FrifloEngineEcs_MonoThread | 0 | 56.43 μs | 3 | 208 B | -| FrifloEngineEcs_SIMD_MonoThread | 0 | 28.78 μs | 2 | 208 B | -| HypEcs_MonoThread | 0 | 56.46 μs | 1 | 72 B | -| HypEcs_MultiThread | 0 | 58.95 μs | 15 | 1832 B | -| LeopotamEcs | 0 | 135.90 μs | 5 | - | -| LeopotamEcsLite | 0 | 1,850.38 μs | 124 | 3 B | -| MonoGameExtended | 0 | 536.11 μs | 10,860 | 161 B | -| Morpeh_Direct | 0 | 2,872.35 μs | 4,500 | 6 B | -| Morpeh_Stash | 0 | 1,034.99 μs | 4,665 | 3 B | -| RelEcs | 0 | 567.56 μs | 16,088 | 121 B | -| SveltoECS | 0 | 197.01 μs | 4 | - | -| | | | | | -| Arch_MonoThread | 10 | 61.75 μs | 2 | - | -| Arch_MultiThread | 10 | 29.50 μs | 1 | - | -| DefaultEcs_ComponentSystem_MonoThread | 10 | 56.25 μs | 1 | - | -| DefaultEcs_ComponentSystem_MultiThread | 10 | 15.31 μs | 1 | - | -| DefaultEcs_EntitySetSystem_MonoThread | 10 | 244.32 μs | 6,200 | 1 B | -| DefaultEcs_EntitySetSystem_MultiThread | 10 | 83.35 μs | 6,806 | - | -| FrifloEngineEcs_MonoThread | 10 | 56.78 μs | 2 | 208 B | -| FrifloEngineEcs_SIMD_MonoThread | 10 | 27.18 μs | 2 | 208 B | -| HypEcs_MonoThread | 10 | 56.78 μs | 1 | 72 B | -| HypEcs_MultiThread | 10 | 60.34 μs | 12 | 1832 B | -| LeopotamEcs | 10 | 136.22 μs | 3 | - | -| LeopotamEcsLite | 10 | 4,020.44 μs | 93,943 | 11 B | -| MonoGameExtended | 10 | 1,996.01 μs | 105,699 | 166 B | -| Morpeh_Direct | 10 | 6,109.28 μs | 167,142 | 11 B | -| Morpeh_Stash | 10 | 3,980.00 μs | 179,288 | 11 B | -| RelEcs | 10 | 1,235.45 μs | 53,159 | 123 B | -| SveltoECS | 10 | 197.04 μs | 3 | - | +> Note: Padding tests were removed for libraries that use archetypes to save space as padding makes no difference in their results + +| Method | EntityPadding | Mean | StdDev | Allocated | +|--------------------------------------- |-------------- |-------------:|-----------:|----------:| +| **Arch_MonoThread** | **0** | **23.420 μs** | **0.0915 μs** | **-** | +| Arch_MonoThread_SourceGenerated | 0 | 23.251 μs | 0.0572 μs | - | +| Arch_MultiThread | 0 | 49.880 μs | 0.1314 μs | - | +| **DefaultEcs_ComponentSystem_MonoThread** | **0** | **21.602 μs** | **0.0286 μs** | **-** | +| DefaultEcs_ComponentSystem_MultiThread | 0 | 5.319 μs | 0.2135 μs | - | +| DefaultEcs_EntitySetSystem_MonoThread | 0 | 95.132 μs | 0.4925 μs | - | +| DefaultEcs_EntitySetSystem_MultiThread | 0 | 11.450 μs | 0.3505 μs | - | +| **Fennecs_ForEach** | **0** | **21.648 μs** | **0.0110 μs** | **-** | +| Fennecs_Job | 0 | 53.325 μs | 0.1703 μs | - | +| Fennecs_Raw | 0 | 43.673 μs | 0.4105 μs | - | +| **FlecsNet_Each** | **0** | **71.867 μs** | **0.8808 μs** | **-** | +| FlecsNet_Iter | 0 | 50.694 μs | 0.0579 μs | - | +| **FrifloEngineEcs_MonoThread** | **0** | **21.537 μs** | **0.0918 μs** | **-** | +| FrifloEngineEcs_MultiThread | 0 | 5.991 μs | 0.2777 μs | - | +| FrifloEngineEcs_SIMD_MonoThread | 0 | 6.411 μs | 0.0190 μs | - | +| **HypEcs_MonoThread** | **0** | **38.163 μs** | **0.1295 μs** | **72 B** | +| HypEcs_MultiThread | 0 | 39.918 μs | 0.1593 μs | 1832 B | +| **LeopotamEcsLite** | **0** | **111.991 μs** | **0.0694 μs** | **-** | +| **LeopotamEcs** | **0** | **83.299 μs** | **0.2094 μs** | **-** | +| **MonoGameExtended** | **0** | **253.155 μs** | **1.1879 μs** | **160 B** | +| **Morpeh_Direct** | **0** | **1,043.726 μs** | **1.3991 μs** | **2 B** | +| Morpeh_Stash | 0 | 568.116 μs | 2.5755 μs | 1 B | +| **Myriad_SingleThread** | **0** | **51.304 μs** | **0.3035 μs** | **-** | +| Myriad_MultiThread | 0 | 837.895 μs | 8.5220 μs | 442063 B | +| Myriad_SingleThreadChunk | 0 | 23.897 μs | 0.1584 μs | - | +| Myriad_MultiThreadChunk | 0 | 21.416 μs | 0.0731 μs | 5411 B | +| Myriad_Enumerable | 0 | 112.296 μs | 0.0526 μs | - | +| Myriad_Delegate | 0 | 67.135 μs | 0.1576 μs | - | +| Myriad_SingleThreadChunk_SIMD | 0 | 9.227 μs | 0.0390 μs | - | +| **RelEcs** | **0** | **183.712 μs** | **0.2183 μs** | **120 B** | +| **SveltoECS** | **0** | **108.539 μs** | **0.4199 μs** | **-** | +| **TinyEcs_Each** | **0** | **29.126 μs** | **0.0905 μs** | **-** | +| TinyEcs_EachJob | 0 | 18.492 μs | 0.0333 μs | 1552 B | +| | | | | | +| **DefaultEcs_ComponentSystem_MonoThread** | **10** | **21.527 μs** | **0.0964 μs** | **-** | +| DefaultEcs_ComponentSystem_MultiThread | 10 | 4.566 μs | 0.0886 μs | - | +| DefaultEcs_EntitySetSystem_MonoThread | 10 | 95.655 μs | 0.0378 μs | - | +| DefaultEcs_EntitySetSystem_MultiThread | 10 | 14.483 μs | 0.5477 μs | - | +| **LeopotamEcsLite** | **10** | **115.782 μs** | **0.4269 μs** | **-** | +| **LeopotamEcs** | **10** | **108.404 μs** | **0.6102 μs** | **-** | +| **MonoGameExtended** | **10** | **373.545 μs** | **2.5163 μs** | **160 B** | +| **Morpeh_Direct** | **10** | **2,598.587 μs** | **18.3321 μs** | **3 B** | +| Morpeh_Stash | 10 | 2,363.997 μs | 97.1307 μs | 3 B | +| **RelEcs** | **10** | **236.031 μs** | **1.5599 μs** | **120 B** | +| **SveltoECS** | **10** | **127.687 μs** | **0.4541 μs** | **-** | ## [SystemWithTwoComponents](results/Ecs.CSharp.Benchmark.SystemWithTwoComponents-report-github.md) Modify entities with two components. The padding aims to simulate real situation when processed entities and their components are not sequential. -| Method | EntityPadding | Mean | CacheMisses/Op | Allocated | -|-------------------------------- |-------------- |------------:|---------------:|----------:| -| Arch_MonoThread | 0 | 174.10 μs | 6 | - | -| Arch_MultiThread | 0 | 36.09 μs | 3 | - | -| DefaultEcs_MonoThread | 0 | 200.28 μs | 8 | - | -| DefaultEcs_MultiThread | 0 | 53.54 μs | 32 | - | -| FrifloEngineEcs_MonoThread | 0 | 84.63 μs | 3 | 216 B | -| FrifloEngineEcs_SIMD_MonoThread | 0 | 32.38 μs | 3 | 216 B | -| HypEcs_MonoThread | 0 | 57.90 μs | 2 | 112 B | -| HypEcs_MultiThread | 0 | 60.35 μs | 13 | 1872 B | -| LeopotamEcs | 0 | 231.52 μs | 6 | - | -| LeopotamEcsLite | 0 | 3,865.86 μs | 607 | 6 B | -| MonoGameExtended | 0 | 827.06 μs | 23,761 | 161 B | -| Morpeh_Direct | 0 | 4,653.57 μs | 6,937 | 11 B | -| Morpeh_Stash | 0 | 2,415.97 μs | 7,613 | 6 B | -| RelEcs | 0 | 628.46 μs | 18,389 | 169 B | -| SveltoECS | 0 | 309.20 μs | 12 | 1 B | -| | | | | | -| Arch_MonoThread | 10 | 174.20 μs | 4 | - | -| Arch_MultiThread | 10 | 35.99 μs | 2 | - | -| DefaultEcs_MonoThread | 10 | 887.92 μs | 59,358 | 1 B | -| DefaultEcs_MultiThread | 10 | 684.24 μs | 79,813 | 1 B | -| FrifloEngineEcs_MonoThread | 10 | 85.35 μs | 3 | 216 B | -| FrifloEngineEcs_SIMD_MonoThread | 10 | 39.45 μs | 3 | 216 B | -| HypEcs_MonoThread | 10 | 58.99 μs | 2 | 112 B | -| HypEcs_MultiThread | 10 | 61.48 μs | 13 | 1872 B | -| LeopotamEcs | 10 | 241.93 μs | 152 | - | -| LeopotamEcsLite | 10 | 8,285.54 μs | 110,260 | 22 B | -| MonoGameExtended | 10 | 2,869.26 μs | 177,309 | 166 B | -| Morpeh_Direct | 10 | 7,882.32 μs | 180,485 | 22 B | -| Morpeh_Stash | 10 | 7,363.95 μs | 193,726 | 11 B | -| RelEcs | 10 | 1,782.27 μs | 106,469 | 171 B | -| SveltoECS | 10 | 1,868.02 μs | 600 | 3 B | - +| Method | EntityPadding | Mean | StdDev | Allocated | +|-------------------------------- |-------------- |-------------:|------------:|----------:| +| **Arch_MonoThread** | **0** | **45.308 μs** | **0.1236 μs** | **-** | +| Arch_MonoThread_SourceGenerated | 0 | 28.794 μs | 0.0600 μs | - | +| Arch_MultiThread | 0 | 57.264 μs | 0.0727 μs | - | +| **DefaultEcs_MonoThread** | **0** | **110.189 μs** | **0.0846 μs** | **-** | +| DefaultEcs_MultiThread | 0 | 16.247 μs | 0.8215 μs | - | +| **Fennecs_ForEach** | **0** | **44.249 μs** | **0.1111 μs** | **-** | +| Fennecs_Job | 0 | 50.736 μs | 0.1419 μs | - | +| Fennecs_Raw | 0 | 43.445 μs | 0.2376 μs | - | +| **FlecsNet_Each** | **0** | **196.370 μs** | **17.8606 μs** | **-** | +| FlecsNet_Iter | 0 | 62.017 μs | 0.2454 μs | - | +| **FrifloEngineEcs_MonoThread** | **0** | **45.461 μs** | **0.0384 μs** | **-** | +| FrifloEngineEcs_MultiThread | 0 | 8.368 μs | 0.4414 μs | - | +| FrifloEngineEcs_SIMD_MonoThread | 0 | 8.607 μs | 0.0630 μs | - | +| **HypEcs_MonoThread** | **0** | **32.666 μs** | **0.0306 μs** | **112 B** | +| HypEcs_MultiThread | 0 | 34.746 μs | 0.1640 μs | 1872 B | +| **LeopotamEcsLite** | **0** | **155.337 μs** | **0.4928 μs** | **-** | +| **LeopotamEcs** | **0** | **125.247 μs** | **0.3555 μs** | **-** | +| **MonoGameExtended** | **0** | **300.108 μs** | **0.2734 μs** | **160 B** | +| **Morpeh_Direct** | **0** | **1,842.942 μs** | **31.7401 μs** | **2 B** | +| Morpeh_Stash | 0 | 836.561 μs | 3.2319 μs | 1 B | +| **Myriad_SingleThread** | **0** | **54.268 μs** | **0.2703 μs** | **-** | +| Myriad_MultiThread | 0 | 982.415 μs | 8.7288 μs | 472799 B | +| Myriad_SingleThreadChunk | 0 | 39.777 μs | 0.0332 μs | - | +| Myriad_MultiThreadChunk | 0 | 22.829 μs | 0.0407 μs | 5464 B | +| Myriad_Enumerable | 0 | 234.799 μs | 0.9445 μs | - | +| Myriad_Delegate | 0 | 87.757 μs | 0.3752 μs | - | +| Myriad_SingleThreadChunk_SIMD | 0 | 12.391 μs | 0.0837 μs | - | +| **RelEcs** | **0** | **204.882 μs** | **0.2625 μs** | **168 B** | +| **SveltoECS** | **0** | **217.040 μs** | **0.6463 μs** | **-** | +| **TinyEcs_Each** | **0** | **26.479 μs** | **0.0787 μs** | **-** | +| TinyEcs_EachJob | 0 | 18.590 μs | 0.0992 μs | 1552 B | +| | | | | | +| **DefaultEcs_MonoThread** | **10** | **135.716 μs** | **0.6646 μs** | **-** | +| DefaultEcs_MultiThread | 10 | 35.017 μs | 7.2481 μs | - | +| **LeopotamEcsLite** | **10** | **182.237 μs** | **0.6589 μs** | **-** | +| **LeopotamEcs** | **10** | **133.385 μs** | **0.3604 μs** | **-** | +| **MonoGameExtended** | **10** | **852.321 μs** | **4.4179 μs** | **161 B** | +| **Morpeh_Direct** | **10** | **8,316.462 μs** | **159.6963 μs** | **12 B** | +| Morpeh_Stash | 10 | 5,149.691 μs | 54.2104 μs | 6 B | +| **RelEcs** | **10** | **294.985 μs** | **2.3202 μs** | **168 B** | +| **SveltoECS** | **10** | **1,304.605 μs** | **5.5623 μs** | **2 B** | ## [SystemWithThreeComponents](results/Ecs.CSharp.Benchmark.SystemWithThreeComponents-report-github.md) Modify entities with three components. The padding aims to simulate real situation when processed entities and their components are not sequential. -| Method | EntityPadding | Mean | CacheMisses/Op | Allocated | -|-------------------------------- |-------------- |-------------:|---------------:|----------:| -| Arch_MonoThread | 0 | 110.90 μs | 6 | - | -| Arch_MultiThread | 0 | 40.42 μs | 4 | - | -| DefaultEcs_MonoThread | 0 | 315.25 μs | 30 | 1 B | -| DefaultEcs_MultiThread | 0 | 87.33 μs | 84 | - | -| FrifloEngineEcs_MonoThread | 0 | 70.08 ns | 0 | 168 B | -| FrifloEngineEcs_SIMD_MonoThread | 0 | 68.65 ns | 0 | 168 B | -| HypEcs_MonoThread | 0 | 85.20 μs | 4 | 152 B | -| HypEcs_MultiThread | 0 | 87.86 μs | 16 | 1912 B | -| LeopotamEcs | 0 | 337.48 μs | 15 | 1 B | -| LeopotamEcsLite | 0 | 5,846.36 μs | 1,855 | 11 B | -| MonoGameExtended | 0 | 1,078.86 μs | 36,031 | 163 B | -| Morpeh_Direct | 0 | 6,529.41 μs | 8,788 | 22 B | -| Morpeh_Stash | 0 | 3,111.72 μs | 9,658 | 6 B | -| RelEcs | 0 | 903.30 μs | 35,170 | 217 B | -| SveltoECS | 0 | 478.11 μs | 13 | 1 B | -| | | | | | -| Arch_MonoThread | 10 | 111.05 μs | 6 | - | -| Arch_MultiThread | 10 | 40.22 μs | 3 | - | -| DefaultEcs_MonoThread | 10 | 1,087.29 μs | 52,219 | 3 B | -| DefaultEcs_MultiThread | 10 | 966.01 μs | 123,190 | 1 B | -| FrifloEngineEcs_MonoThread | 10 | 69.85 ns | 0 | 168 B | -| FrifloEngineEcs_SIMD_MonoThread | 10 | 71.10 ns | 0 | 168 B | -| HypEcs_MonoThread | 10 | 84.86 μs | 4 | 152 B | -| HypEcs_MultiThread | 10 | 87.58 μs | 15 | 1912 B | -| LeopotamEcs | 10 | 503.75 μs | 1,841 | 1 B | -| LeopotamEcsLite | 10 | 11,357.17 μs | 111,617 | 22 B | -| MonoGameExtended | 10 | 3,491.99 μs | 242,196 | 166 B | -| Morpeh_Direct | 10 | 9,850.22 μs | 204,342 | 22 B | -| Morpeh_Stash | 10 | 8,283.08 μs | 186,510 | 22 B | -| RelEcs | 10 | 2,236.64 μs | 164,969 | 222 B | -| SveltoECS | 10 | NA | NA | NA | +| Method | EntityPadding | Mean | StdDev | Allocated | +|-------------------------------- |-------------- |--------------:|------------:|----------:| +| **Arch_MonoThread** | **0** | **51.312 μs** | **0.1633 μs** | **-** | +| Arch_MonoThread_SourceGenerated | 0 | 135.426 μs | 0.6915 μs | - | +| Arch_MultiThread | 0 | 61.860 μs | 0.4861 μs | - | +| **DefaultEcs_MonoThread** | **0** | **141.616 μs** | **0.4521 μs** | **-** | +| DefaultEcs_MultiThread | 0 | 23.877 μs | 1.1962 μs | - | +| **Fennecs_ForEach** | **0** | **64.932 μs** | **0.2161 μs** | **-** | +| Fennecs_Job | 0 | 53.470 μs | 0.0521 μs | - | +| Fennecs_Raw | 0 | 65.706 μs | 0.3044 μs | - | +| **FlecsNet_Each** | **0** | **220.183 μs** | **0.4932 μs** | **-** | +| FlecsNet_Iter | 0 | 76.079 μs | 0.4874 μs | - | +| **FrifloEngineEcs_MonoThread** | **0** | **44.047 μs** | **0.0184 μs** | **-** | +| FrifloEngineEcs_MultiThread | 0 | 9.069 μs | 0.3902 μs | - | +| FrifloEngineEcs_SIMD_MonoThread | 0 | 10.892 μs | 0.0844 μs | - | +| **HypEcs_MonoThread** | **0** | **44.443 μs** | **0.0298 μs** | **152 B** | +| HypEcs_MultiThread | 0 | 46.400 μs | 0.1855 μs | 1912 B | +| **LeopotamEcsLite** | **0** | **234.923 μs** | **0.3102 μs** | **-** | +| **LeopotamEcs** | **0** | **184.047 μs** | **0.6268 μs** | **-** | +| **MonoGameExtended** | **0** | **389.794 μs** | **0.4324 μs** | **160 B** | +| **Morpeh_Direct** | **0** | **2,346.662 μs** | **10.2549 μs** | **3 B** | +| Morpeh_Stash | 0 | 985.408 μs | 6.0252 μs | 2 B | +| **Myriad_SingleThread** | **0** | **55.562 μs** | **0.3409 μs** | **-** | +| Myriad_MultiThread | 0 | 1,094.648 μs | 7.6782 μs | 490610 B | +| Myriad_SingleThreadChunk | 0 | 48.025 μs | 0.1687 μs | - | +| Myriad_MultiThreadChunk | 0 | 24.359 μs | 0.0986 μs | 5515 B | +| Myriad_Enumerable | 0 | 245.209 μs | 1.3090 μs | - | +| Myriad_Delegate | 0 | 90.019 μs | 0.0226 μs | - | +| **RelEcs** | **0** | **247.398 μs** | **0.6877 μs** | **217 B** | +| **SveltoECS** | **0** | **322.910 μs** | **2.8128 μs** | **-** | +| **TinyEcs_Each** | **0** | **39.623 μs** | **0.1817 μs** | **-** | +| TinyEcs_EachJob | 0 | 20.120 μs | 0.0635 μs | 1560 B | +| | | | | | +| **DefaultEcs_MonoThread** | **10** | **200.186 μs** | **1.2432 μs** | **-** | +| DefaultEcs_MultiThread | 10 | 124.775 μs | 9.4812 μs | - | +| **LeopotamEcsLite** | **10** | **255.790 μs** | **1.3398 μs** | **-** | +| **LeopotamEcs** | **10** | **188.907 μs** | **0.1537 μs** | **-** | +| **MonoGameExtended** | **10** | **1,683.746 μs** | **14.3184 μs** | **162 B** | +| **Morpeh_Direct** | **10** | **10,861.445 μs** | **222.8097 μs** | **12 B** | +| Morpeh_Stash | 10 | 5,924.703 μs | 186.3500 μs | 6 B | +| **RelEcs** | **10** | **365.176 μs** | **3.8175 μs** | **216 B** | +| **SveltoECS** | **10** | **NA** | **NA** | **NA** | + ## [SystemWithTwoComponentsMultipleComposition](results/Ecs.CSharp.Benchmark.SystemWithTwoComponentsMultipleComposition-report-github.md) Modify entities with two components while different entity compositions match the the components query. -| Method | Mean | CacheMisses/Op | Allocated | -|-------------------------------- |------------:|---------------:|----------:| -| Arch | 90.87 μs | 2 | - | -| Arch_MultiThread | 55.64 μs | 3 | - | -| DefaultEcs_MonoThread | 197.71 μs | 5 | - | -| DefaultEcs_MultiThread | 52.81 μs | 4 | - | -| FrifloEngineEcs_MonoThread | 84.88 μs | 3 | 304 B | -| FrifloEngineEcs_SIMD_MonoThread | 38.22 μs | 3 | 304 B | -| HypEcs_MonoThread | 58.38 μs | 3 | 352 B | -| HypEcs_MultiThread | 21.73 μs | 11 | 2655 B | -| LeopotamEcs | 235.56 μs | 5 | - | -| LeopotamEcsLite | 3,703.18 μs | 594 | 7 B | -| MonoGameExtended | 1,015.73 μs | 40,470 | 163 B | -| Morpeh_Direct | 5,087.22 μs | 114,642 | 14 B | -| Morpeh_Stash | 3,863.37 μs | 116,809 | 7 B | -| RelEcs | 1,564.69 μs | 83,810 | 491 B | -| SveltoECS | 309.39 μs | 7 | 1 B | +| Method | Mean | StdDev | Allocated | +|-------------------------------- |-------------:|-----------:|----------:| +| Arch | 45.588 μs | 0.1559 μs | - | +| Arch_MonoThread_SourceGenerated | 28.864 μs | 0.1477 μs | - | +| Arch_MultiThread | 216.326 μs | 0.4440 μs | - | +| DefaultEcs_MonoThread | 111.634 μs | 0.2742 μs | - | +| DefaultEcs_MultiThread | 17.336 μs | 0.7883 μs | - | +| Fennecs_ForEach | 45.614 μs | 0.2408 μs | - | +| Fennecs_Job | 54.985 μs | 0.1906 μs | - | +| Fennecs_Raw | 44.672 μs | 0.2179 μs | - | +| FlecsNet_Each | 206.724 μs | 0.1340 μs | - | +| FlecsNet_Iter | 58.126 μs | 0.2709 μs | - | +| FrifloEngineEcs_MonoThread | 45.401 μs | 0.2210 μs | - | +| FrifloEngineEcs_MultiThread | 21.822 μs | 0.9865 μs | - | +| FrifloEngineEcs_SIMD_MonoThread | 9.130 μs | 0.0388 μs | - | +| HypEcs_MonoThread | 33.012 μs | 0.1687 μs | 352 B | +| HypEcs_MultiThread | 11.779 μs | 0.3269 μs | 2826 B | +| LeopotamEcsLite | 155.412 μs | 0.0566 μs | - | +| LeopotamEcs | 124.123 μs | 0.5029 μs | - | +| MonoGameExtended | 301.107 μs | 1.0381 μs | 160 B | +| Morpeh_Direct | 1,518.622 μs | 11.4268 μs | 2 B | +| Morpeh_Stash | 862.835 μs | 6.5229 μs | 1 B | +| Myriad_SingleThread | 54.953 μs | 0.1836 μs | - | +| Myriad_MultiThread | 985.841 μs | 10.3412 μs | 477241 B | +| Myriad_SingleThreadChunk | 40.976 μs | 0.0621 μs | - | +| Myriad_MultiThreadChunk | 54.084 μs | 0.2662 μs | 19365 B | +| Myriad_Enumerable | 241.300 μs | 1.0275 μs | - | +| Myriad_Delegate | 67.886 μs | 0.2663 μs | - | +| Myriad_SingleThreadChunk_SIMD | 12.698 μs | 0.0845 μs | - | +| RelEcs | 327.387 μs | 5.2210 μs | 488 B | +| SveltoECS | 195.377 μs | 0.8394 μs | - | +| TinyEcs_Each | 26.289 μs | 0.0699 μs | - | +| TinyEcs_EachJob | 18.676 μs | 0.0397 μs | 2080 B | + # Other benchmarks diff --git a/results/Ecs.CSharp.Benchmark.CreateEntityWithOneComponent-report-github.md b/results/Ecs.CSharp.Benchmark.CreateEntityWithOneComponent-report-github.md index d6b5117..a729751 100644 --- a/results/Ecs.CSharp.Benchmark.CreateEntityWithOneComponent-report-github.md +++ b/results/Ecs.CSharp.Benchmark.CreateEntityWithOneComponent-report-github.md @@ -1,24 +1,28 @@ ``` -BenchmarkDotNet v0.13.12, Windows 10 (10.0.19045.3930/22H2/2022Update) -Intel Core i5-3570K CPU 3.40GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores -.NET SDK 8.0.101 - [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX - Job-VKIYYA : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX +BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3447/23H2/2023Update/SunValley3) +AMD Ryzen 9 5900X, 1 CPU, 24 logical and 12 physical cores +.NET SDK 8.0.204 + [Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 + Job-AYWANY : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 InvocationCount=1 UnrollFactor=1 ``` -| Method | EntityCount | Mean | Error | StdDev | Gen0 | CacheMisses/Op | Gen1 | Gen2 | Allocated | -|----------------- |------------ |----------:|----------:|----------:|----------:|---------------:|----------:|----------:|------------:| -| Arch | 100000 | 18.022 ms | 2.5042 ms | 7.3838 ms | 1000.0000 | 78,889 | 1000.0000 | 1000.0000 | 9725.83 KB | -| DefaultEcs | 100000 | 8.520 ms | 0.1702 ms | 0.2700 ms | 2000.0000 | 105,229 | 2000.0000 | 2000.0000 | 11324.68 KB | -| FrifloEngineEcs | 100000 | 3.467 ms | 0.0672 ms | 0.0747 ms | 1000.0000 | 45,714 | 1000.0000 | 1000.0000 | 5724.16 KB | -| HypEcs | 100000 | 15.946 ms | 0.2232 ms | 0.1863 ms | 5000.0000 | 238,660 | 2000.0000 | 2000.0000 | 25825.74 KB | -| LeopotamEcs | 100000 | 20.304 ms | 0.4022 ms | 0.8995 ms | 2000.0000 | 257,024 | 1000.0000 | 1000.0000 | 13684.03 KB | -| LeopotamEcsLite | 100000 | 11.568 ms | 0.1902 ms | 0.1779 ms | 2000.0000 | 100,489 | 2000.0000 | 2000.0000 | 8170.31 KB | -| MonoGameExtended | 100000 | 28.082 ms | 0.2086 ms | 0.1952 ms | 2000.0000 | 254,089 | 2000.0000 | 2000.0000 | 16412.13 KB | -| Morpeh_Direct | 100000 | 13.625 ms | 0.2660 ms | 0.3981 ms | 1000.0000 | 133,698 | 1000.0000 | 1000.0000 | 12481.63 KB | -| Morpeh_Stash | 100000 | 13.183 ms | 0.1900 ms | 0.1777 ms | 1000.0000 | 132,164 | 1000.0000 | 1000.0000 | 12481.63 KB | -| RelEcs | 100000 | 43.917 ms | 0.8666 ms | 1.0960 ms | 3000.0000 | 744,480 | 3000.0000 | 2000.0000 | 29705.35 KB | -| SveltoECS | 100000 | 36.594 ms | 0.7295 ms | 1.0227 ms | - | 751,995 | - | - | 1.25 KB | +| Method | EntityCount | Mean | Error | StdDev | Gen0 | Gen1 | Gen2 | Allocated | +|----------------- |------------ |----------:|----------:|----------:|----------:|----------:|----------:|------------:| +| Arch | 100000 | 7.039 ms | 0.0727 ms | 0.0645 ms | - | - | - | 3178.16 KB | +| DefaultEcs | 100000 | 11.389 ms | 0.2068 ms | 0.1834 ms | - | - | - | 11321.11 KB | +| Fennecs | 100000 | 10.429 ms | 0.1862 ms | 0.3498 ms | - | - | - | 13636.45 KB | +| FlecsNet | 100000 | 6.431 ms | 0.1286 ms | 0.1844 ms | - | - | - | 2.73 KB | +| FrifloEngineEcs | 100000 | 2.837 ms | 0.1132 ms | 0.3247 ms | 1000.0000 | 1000.0000 | 1000.0000 | 5722.08 KB | +| LeopotamEcsLite | 100000 | 3.608 ms | 0.1019 ms | 0.2956 ms | - | - | - | 7151.08 KB | +| LeopotamEcs | 100000 | 6.285 ms | 0.1963 ms | 0.5788 ms | - | - | - | 13685.65 KB | +| MonoGameExtended | 100000 | 8.255 ms | 0.5311 ms | 1.5408 ms | - | - | - | 16408.89 KB | +| Morpeh_Direct | 100000 | 58.202 ms | 2.8245 ms | 8.1945 ms | 2000.0000 | 2000.0000 | 1000.0000 | 41305.76 KB | +| Morpeh_Stash | 100000 | 45.100 ms | 1.4572 ms | 4.1339 ms | 2000.0000 | 2000.0000 | 1000.0000 | 41305.76 KB | +| Myriad | 100000 | 10.845 ms | 0.2089 ms | 0.2996 ms | - | - | - | 6914.67 KB | +| HypEcs | 100000 | 9.897 ms | 0.1977 ms | 0.4462 ms | - | - | - | 25827.05 KB | +| RelEcs | 100000 | 14.758 ms | 0.2924 ms | 0.6834 ms | 1000.0000 | - | - | 29706.66 KB | +| SveltoECS | 100000 | 21.747 ms | 0.4257 ms | 1.0680 ms | - | - | - | 3.22 KB | +| TinyEcs | 100000 | 7.454 ms | 0.1474 ms | 0.1306 ms | - | - | - | 7834.44 KB | diff --git a/results/Ecs.CSharp.Benchmark.CreateEntityWithThreeComponents-report-github.md b/results/Ecs.CSharp.Benchmark.CreateEntityWithThreeComponents-report-github.md index d1e3213..3acbde9 100644 --- a/results/Ecs.CSharp.Benchmark.CreateEntityWithThreeComponents-report-github.md +++ b/results/Ecs.CSharp.Benchmark.CreateEntityWithThreeComponents-report-github.md @@ -1,24 +1,28 @@ ``` -BenchmarkDotNet v0.13.12, Windows 10 (10.0.19045.3930/22H2/2022Update) -Intel Core i5-3570K CPU 3.40GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores -.NET SDK 8.0.101 - [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX - Job-VKIYYA : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX +BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3447/23H2/2023Update/SunValley3) +AMD Ryzen 9 5900X, 1 CPU, 24 logical and 12 physical cores +.NET SDK 8.0.204 + [Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 + Job-AYWANY : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 InvocationCount=1 UnrollFactor=1 ``` -| Method | EntityCount | Mean | Error | StdDev | CacheMisses/Op | Gen0 | Gen1 | Gen2 | Allocated | -|----------------- |------------ |----------:|---------:|---------:|---------------:|-----------:|----------:|----------:|------------:| -| Arch | 100000 | 12.87 ms | 0.252 ms | 0.299 ms | 65,081 | - | - | - | 10381.21 KB | -| DefaultEcs | 100000 | 17.90 ms | 0.149 ms | 0.183 ms | 226,834 | 2000.0000 | 2000.0000 | 2000.0000 | 19515.29 KB | -| FrifloEngineEcs | 100000 | 3.421 ms | 0.067 ms | 0.116 ms | 42,792 | 1000.0000 | 1000.0000 | 1000.0000 | 6758.40 KB | -| HypEcs | 100000 | 50.00 ms | 0.992 ms | 1.019 ms | 513,928 | 19000.0000 | 3000.0000 | 3000.0000 | 68747.41 KB | -| LeopotamEcs | 100000 | 28.95 ms | 0.778 ms | 2.244 ms | 249,774 | 2000.0000 | 1000.0000 | 1000.0000 | 15734.71 KB | -| LeopotamEcsLite | 100000 | 26.25 ms | 0.353 ms | 0.330 ms | 150,733 | 2000.0000 | 2000.0000 | 2000.0000 | 12268.14 KB | -| MonoGameExtended | 100000 | 57.80 ms | 1.110 ms | 1.140 ms | 1,216,620 | 4000.0000 | 3000.0000 | 2000.0000 | 30152.63 KB | -| Morpeh_Direct | 100000 | 34.79 ms | 0.595 ms | 0.556 ms | 304,068 | 2000.0000 | 2000.0000 | 1000.0000 | 26114.95 KB | -| Morpeh_Stash | 100000 | 16.57 ms | 0.150 ms | 0.140 ms | 151,006 | 1000.0000 | 1000.0000 | 1000.0000 | 15896.18 KB | -| RelEcs | 100000 | 129.63 ms | 2.587 ms | 6.905 ms | 1,929,645 | 11000.0000 | 4000.0000 | 2000.0000 | 75704.51 KB | -| SveltoECS | 100000 | 78.32 ms | 1.428 ms | 1.857 ms | 1,592,638 | - | - | - | 2.67 KB | +| Method | EntityCount | Mean | Error | StdDev | Median | Gen0 | Gen1 | Gen2 | Allocated | +|----------------- |------------ |-----------:|----------:|----------:|-----------:|----------:|----------:|----------:|------------:| +| Arch | 100000 | 3.316 ms | 0.0507 ms | 0.0901 ms | 3.277 ms | - | - | - | 3947.67 KB | +| SveltoECS | 100000 | 46.643 ms | 0.9223 ms | 2.0437 ms | 46.569 ms | - | - | - | 4.64 KB | +| DefaultEcs | 100000 | 10.885 ms | 0.2153 ms | 0.4542 ms | 10.896 ms | - | - | - | 19516.68 KB | +| Fennecs | 100000 | 24.621 ms | 0.2870 ms | 0.2685 ms | 24.520 ms | - | - | - | 16713.12 KB | +| FlecsNet | 100000 | 16.746 ms | 0.2449 ms | 0.2291 ms | 16.665 ms | - | - | - | 3.48 KB | +| FrifloEngineEcs | 100000 | 2.525 ms | 0.0519 ms | 0.1481 ms | 2.490 ms | 1000.0000 | 1000.0000 | 1000.0000 | 6750.23 KB | +| HypEcs | 100000 | 30.509 ms | 0.6019 ms | 0.8438 ms | 30.301 ms | 4000.0000 | 3000.0000 | 1000.0000 | 68750.7 KB | +| LeopotamEcsLite | 100000 | 5.995 ms | 0.1867 ms | 0.5505 ms | 6.015 ms | - | - | - | 11248.14 KB | +| LeopotamEcs | 100000 | 8.869 ms | 0.1899 ms | 0.5571 ms | 8.890 ms | - | - | - | 15736.4 KB | +| MonoGameExtended | 100000 | 21.133 ms | 0.4027 ms | 0.9090 ms | 21.204 ms | - | - | - | 30154.05 KB | +| Morpeh_Direct | 100000 | 147.879 ms | 2.8021 ms | 2.6211 ms | 147.521 ms | 5000.0000 | 5000.0000 | 1000.0000 | 83802.09 KB | +| Morpeh_Stash | 100000 | 52.206 ms | 0.9679 ms | 1.7453 ms | 52.061 ms | 3000.0000 | 3000.0000 | 2000.0000 | 44724.3 KB | +| Myriad | 100000 | 22.632 ms | 0.2139 ms | 0.1896 ms | 22.642 ms | - | - | - | 7704.88 KB | +| RelEcs | 100000 | 65.055 ms | 1.2292 ms | 1.1498 ms | 64.518 ms | 3000.0000 | 1000.0000 | - | 75699.76 KB | +| TinyEcs | 100000 | 23.599 ms | 0.1788 ms | 0.1396 ms | 23.566 ms | 1000.0000 | 1000.0000 | - | 21314.25 KB | diff --git a/results/Ecs.CSharp.Benchmark.CreateEntityWithTwoComponents-report-github.md b/results/Ecs.CSharp.Benchmark.CreateEntityWithTwoComponents-report-github.md index 505dd23..fa5a539 100644 --- a/results/Ecs.CSharp.Benchmark.CreateEntityWithTwoComponents-report-github.md +++ b/results/Ecs.CSharp.Benchmark.CreateEntityWithTwoComponents-report-github.md @@ -1,24 +1,28 @@ ``` -BenchmarkDotNet v0.13.12, Windows 10 (10.0.19045.3930/22H2/2022Update) -Intel Core i5-3570K CPU 3.40GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores -.NET SDK 8.0.101 - [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX - Job-VKIYYA : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX +BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3447/23H2/2023Update/SunValley3) +AMD Ryzen 9 5900X, 1 CPU, 24 logical and 12 physical cores +.NET SDK 8.0.204 + [Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 + Job-AYWANY : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 InvocationCount=1 UnrollFactor=1 ``` -| Method | EntityCount | Mean | Error | StdDev | CacheMisses/Op | Gen0 | Gen1 | Gen2 | Allocated | -|----------------- |------------ |----------:|---------:|---------:|---------------:|-----------:|----------:|----------:|------------:| -| Arch | 100000 | 11.17 ms | 0.221 ms | 0.310 ms | 64,717 | - | - | - | 9891.36 KB | -| DefaultEcs | 100000 | 13.93 ms | 0.159 ms | 0.212 ms | 167,855 | 2000.0000 | 2000.0000 | 2000.0000 | 15417.46 KB | -| FrifloEngineEcs | 100000 | 3.40 ms | 0.063 ms | 0.065 ms | 43,128 | 1000.0000 | 1000.0000 | 1000.0000 | 6236.16 KB | -| HypEcs | 100000 | 31.64 ms | 0.548 ms | 0.538 ms | 348,540 | 11000.0000 | 2000.0000 | 2000.0000 | 45333.08 KB | -| LeopotamEcs | 100000 | 18.57 ms | 0.353 ms | 0.571 ms | 261,029 | 2000.0000 | 1000.0000 | 1000.0000 | 14709.41 KB | -| LeopotamEcsLite | 100000 | 18.97 ms | 0.217 ms | 0.203 ms | 114,688 | 2000.0000 | 2000.0000 | 2000.0000 | 10219.18 KB | -| MonoGameExtended | 100000 | 46.98 ms | 0.939 ms | 1.644 ms | 578,387 | 3000.0000 | 3000.0000 | 3000.0000 | 23372.71 KB | -| Morpeh_Direct | 100000 | 68.96 ms | 1.364 ms | 1.624 ms | 688,518 | 5000.0000 | 2000.0000 | 2000.0000 | 42308.41 KB | -| Morpeh_Stash | 100000 | 24.12 ms | 0.778 ms | 2.233 ms | 202,301 | 2000.0000 | 2000.0000 | 1000.0000 | 19310.76 KB | -| RelEcs | 100000 | 102.98 ms | 1.370 ms | 1.144 ms | 1,332,887 | 7000.0000 | 4000.0000 | 2000.0000 | 50755.08 KB | -| SveltoECS | 100000 | 58.31 ms | 1.165 ms | 2.009 ms | 1,274,636 | - | - | - | 2.17 KB | +| Method | EntityCount | Mean | Error | StdDev | Gen0 | Gen1 | Gen2 | Allocated | +|----------------- |------------ |-----------:|----------:|----------:|----------:|----------:|----------:|-------------:| +| Arch | 100000 | 6.840 ms | 0.1024 ms | 0.0855 ms | - | - | - | 3558.44 KB | +| DefaultEcs | 100000 | 8.515 ms | 0.1698 ms | 0.2086 ms | - | - | - | 15418.9 KB | +| Fennecs | 100000 | 15.376 ms | 0.1777 ms | 0.1575 ms | - | - | - | 15174.45 KB | +| FlecsNet | 100000 | 11.082 ms | 0.1213 ms | 0.0947 ms | - | - | - | 3.11 KB | +| FrifloEngineEcs | 100000 | 2.522 ms | 0.0625 ms | 0.1804 ms | 1000.0000 | 1000.0000 | 1000.0000 | 6236.16 KB | +| HypEcs | 100000 | 18.703 ms | 0.3537 ms | 0.3473 ms | 1000.0000 | 1000.0000 | - | 45334.39 KB | +| LeopotamEcsLite | 100000 | 5.162 ms | 0.1030 ms | 0.3004 ms | - | - | - | 9199.61 KB | +| LeopotamEcs | 100000 | 6.982 ms | 0.1535 ms | 0.4454 ms | - | - | - | 14711.02 KB | +| MonoGameExtended | 100000 | 13.274 ms | 0.2631 ms | 0.6977 ms | - | - | - | 23373.84 KB | +| Morpeh_Direct | 100000 | 239.144 ms | 4.5725 ms | 4.4908 ms | 8000.0000 | 8000.0000 | 2000.0000 | 128867.66 KB | +| Morpeh_Stash | 100000 | 39.734 ms | 0.8404 ms | 2.4779 ms | 2000.0000 | 1000.0000 | 1000.0000 | 48133.7 KB | +| Myriad | 100000 | 15.280 ms | 0.1736 ms | 0.1624 ms | - | - | - | 7309.77 KB | +| RelEcs | 100000 | 36.776 ms | 0.7042 ms | 0.6916 ms | 2000.0000 | 1000.0000 | - | 50749.86 KB | +| SveltoECS | 100000 | 34.237 ms | 0.6083 ms | 0.6508 ms | - | - | - | 4.14 KB | +| TinyEcs | 100000 | 14.042 ms | 0.1534 ms | 0.1360 ms | - | - | - | 13785.08 KB | diff --git a/results/Ecs.CSharp.Benchmark.SystemWithOneComponent-report-github.md b/results/Ecs.CSharp.Benchmark.SystemWithOneComponent-report-github.md index c804490..6e007eb 100644 --- a/results/Ecs.CSharp.Benchmark.SystemWithOneComponent-report-github.md +++ b/results/Ecs.CSharp.Benchmark.SystemWithOneComponent-report-github.md @@ -1,47 +1,78 @@ ``` -BenchmarkDotNet v0.13.12, Windows 10 (10.0.19045.3930/22H2/2022Update) -Intel Core i5-3570K CPU 3.40GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores -.NET SDK 8.0.101 - [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX - DefaultJob : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX +BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3447/23H2/2023Update/SunValley3) +AMD Ryzen 9 5900X, 1 CPU, 24 logical and 12 physical cores +.NET SDK 8.0.204 + [Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 + DefaultJob : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 ``` -| Method | EntityCount | EntityPadding | Mean | Error | StdDev | Gen0 | CacheMisses/Op | Allocated | -|--------------------------------------- |------------ |-------------- |------------:|----------:|----------:|-------:|---------------:|----------:| -| Arch_MonoThread | 100000 | 0 | 61.77 μs | 0.013 μs | 0.011 μs | - | 2 | - | -| Arch_MultiThread | 100000 | 0 | 29.30 μs | 0.012 μs | 0.011 μs | - | 1 | - | -| DefaultEcs_ComponentSystem_MonoThread | 100000 | 0 | 56.25 μs | 0.008 μs | 0.008 μs | - | 1 | - | -| DefaultEcs_ComponentSystem_MultiThread | 100000 | 0 | 15.21 μs | 0.067 μs | 0.060 μs | - | 1 | - | -| DefaultEcs_EntitySetSystem_MonoThread | 100000 | 0 | 118.02 μs | 0.021 μs | 0.020 μs | - | 3 | - | -| DefaultEcs_EntitySetSystem_MultiThread | 100000 | 0 | 31.55 μs | 0.137 μs | 0.107 μs | - | 3 | - | -| FrifloEngineEcs_MonoThread | 100000 | 0 | 56.43 μs | 0.021 μs | 0.018 μs | 0.0610 | 3 | 208 B | -| FrifloEngineEcs_SIMD_MonoThread | 100000 | 0 | 28.78 μs | 0.020 μs | 0.015 μs | 0.0610 | 2 | 208 B | -| HypEcs_MonoThread | 100000 | 0 | 56.46 μs | 0.006 μs | 0.005 μs | - | 1 | 72 B | -| HypEcs_MultiThread | 100000 | 0 | 58.95 μs | 0.052 μs | 0.046 μs | 0.4883 | 15 | 1832 B | -| LeopotamEcs | 100000 | 0 | 135.90 μs | 0.025 μs | 0.022 μs | - | 5 | - | -| LeopotamEcsLite | 100000 | 0 | 1,850.38 μs | 0.312 μs | 0.276 μs | - | 124 | 3 B | -| MonoGameExtended | 100000 | 0 | 536.11 μs | 1.050 μs | 0.931 μs | - | 10,860 | 161 B | -| Morpeh_Direct | 100000 | 0 | 2,872.35 μs | 1.397 μs | 1.239 μs | - | 4,500 | 6 B | -| Morpeh_Stash | 100000 | 0 | 1,034.99 μs | 0.379 μs | 0.336 μs | - | 4,665 | 3 B | -| RelEcs | 100000 | 0 | 567.56 μs | 2.466 μs | 2.307 μs | - | 16,088 | 121 B | -| SveltoECS | 100000 | 0 | 197.01 μs | 0.022 μs | 0.018 μs | - | 4 | - | -| | | | | | | | | | -| Arch_MonoThread | 100000 | 10 | 61.75 μs | 0.033 μs | 0.029 μs | - | 2 | - | -| Arch_MultiThread | 100000 | 10 | 29.50 μs | 0.018 μs | 0.014 μs | - | 1 | - | -| DefaultEcs_ComponentSystem_MonoThread | 100000 | 10 | 56.25 μs | 0.008 μs | 0.007 μs | - | 1 | - | -| DefaultEcs_ComponentSystem_MultiThread | 100000 | 10 | 15.31 μs | 0.044 μs | 0.039 μs | - | 1 | - | -| DefaultEcs_EntitySetSystem_MonoThread | 100000 | 10 | 244.32 μs | 0.188 μs | 0.176 μs | - | 6,200 | 1 B | -| DefaultEcs_EntitySetSystem_MultiThread | 100000 | 10 | 83.35 μs | 0.318 μs | 0.298 μs | - | 6,806 | - | -| FrifloEngineEcs_MonoThread | 100000 | 10 | 56.78 μs | 0.107 μs | 0.100 μs | 0.0610 | 2 | 208 B | -| FrifloEngineEcs_SIMD_MonoThread | 100000 | 10 | 27.18 μs | 0.002 μs | 0.002 μs | 0.0610 | 2 | 208 B | -| HypEcs_MonoThread | 100000 | 10 | 56.78 μs | 0.170 μs | 0.159 μs | - | 1 | 72 B | -| HypEcs_MultiThread | 100000 | 10 | 60.34 μs | 0.101 μs | 0.094 μs | 0.4883 | 12 | 1832 B | -| LeopotamEcs | 100000 | 10 | 136.22 μs | 0.022 μs | 0.020 μs | - | 3 | - | -| LeopotamEcsLite | 100000 | 10 | 4,020.44 μs | 2.468 μs | 2.061 μs | - | 93,943 | 11 B | -| MonoGameExtended | 100000 | 10 | 1,996.01 μs | 28.602 μs | 23.884 μs | - | 105,699 | 166 B | -| Morpeh_Direct | 100000 | 10 | 6,109.28 μs | 25.304 μs | 23.669 μs | - | 167,142 | 11 B | -| Morpeh_Stash | 100000 | 10 | 3,980.00 μs | 20.224 μs | 18.917 μs | - | 179,288 | 11 B | -| RelEcs | 100000 | 10 | 1,235.45 μs | 5.167 μs | 4.580 μs | - | 53,159 | 123 B | -| SveltoECS | 100000 | 10 | 197.04 μs | 0.026 μs | 0.023 μs | - | 3 | - | +| Method | EntityCount | EntityPadding | Mean | Error | StdDev | Gen0 | Allocated | +|--------------------------------------- |------------ |-------------- |-------------:|-----------:|-----------:|--------:|----------:| +| **Arch_MonoThread** | **100000** | **0** | **23.420 μs** | **0.0978 μs** | **0.0915 μs** | **-** | **-** | +| Arch_MonoThread_SourceGenerated | 100000 | 0 | 23.251 μs | 0.0612 μs | 0.0572 μs | - | - | +| Arch_MultiThread | 100000 | 0 | 49.880 μs | 0.1483 μs | 0.1314 μs | - | - | +| **Arch_MonoThread** | **100000** | **10** | **23.125 μs** | **0.0681 μs** | **0.0637 μs** | **-** | **-** | +| Arch_MonoThread_SourceGenerated | 100000 | 10 | 23.144 μs | 0.1409 μs | 0.1318 μs | - | - | +| Arch_MultiThread | 100000 | 10 | 49.402 μs | 0.1822 μs | 0.1615 μs | - | - | +| **DefaultEcs_ComponentSystem_MonoThread** | **100000** | **0** | **21.602 μs** | **0.0306 μs** | **0.0286 μs** | **-** | **-** | +| DefaultEcs_ComponentSystem_MultiThread | 100000 | 0 | 5.319 μs | 0.1057 μs | 0.2135 μs | - | - | +| DefaultEcs_EntitySetSystem_MonoThread | 100000 | 0 | 95.132 μs | 0.5265 μs | 0.4925 μs | - | - | +| DefaultEcs_EntitySetSystem_MultiThread | 100000 | 0 | 11.450 μs | 0.2251 μs | 0.3505 μs | - | - | +| **DefaultEcs_ComponentSystem_MonoThread** | **100000** | **10** | **21.527 μs** | **0.1031 μs** | **0.0964 μs** | **-** | **-** | +| DefaultEcs_ComponentSystem_MultiThread | 100000 | 10 | 4.566 μs | 0.0797 μs | 0.0886 μs | - | - | +| DefaultEcs_EntitySetSystem_MonoThread | 100000 | 10 | 95.655 μs | 0.0484 μs | 0.0378 μs | - | - | +| DefaultEcs_EntitySetSystem_MultiThread | 100000 | 10 | 14.483 μs | 0.2879 μs | 0.5477 μs | - | - | +| **Fennecs_ForEach** | **100000** | **0** | **21.648 μs** | **0.0124 μs** | **0.0110 μs** | **-** | **-** | +| Fennecs_Job | 100000 | 0 | 53.325 μs | 0.1821 μs | 0.1703 μs | - | - | +| Fennecs_Raw | 100000 | 0 | 43.673 μs | 0.4630 μs | 0.4105 μs | - | - | +| **Fennecs_ForEach** | **100000** | **10** | **21.875 μs** | **0.0299 μs** | **0.0280 μs** | **-** | **-** | +| Fennecs_Job | 100000 | 10 | 53.428 μs | 0.1151 μs | 0.1077 μs | - | - | +| Fennecs_Raw | 100000 | 10 | 43.439 μs | 0.1055 μs | 0.0986 μs | - | - | +| **FlecsNet_Each** | **100000** | **0** | **71.867 μs** | **0.9416 μs** | **0.8808 μs** | **-** | **-** | +| FlecsNet_Iter | 100000 | 0 | 50.694 μs | 0.0619 μs | 0.0579 μs | - | - | +| **FlecsNet_Each** | **100000** | **10** | **71.011 μs** | **0.5452 μs** | **0.4833 μs** | **-** | **-** | +| FlecsNet_Iter | 100000 | 10 | 43.764 μs | 0.1977 μs | 0.1849 μs | - | - | +| **FrifloEngineEcs_MonoThread** | **100000** | **0** | **21.537 μs** | **0.0981 μs** | **0.0918 μs** | **-** | **-** | +| FrifloEngineEcs_MultiThread | 100000 | 0 | 5.991 μs | 0.1188 μs | 0.2777 μs | - | - | +| FrifloEngineEcs_SIMD_MonoThread | 100000 | 0 | 6.411 μs | 0.0203 μs | 0.0190 μs | - | - | +| **FrifloEngineEcs_MonoThread** | **100000** | **10** | **21.633 μs** | **0.1718 μs** | **0.1607 μs** | **-** | **-** | +| FrifloEngineEcs_MultiThread | 100000 | 10 | 5.954 μs | 0.1165 μs | 0.1915 μs | - | - | +| FrifloEngineEcs_SIMD_MonoThread | 100000 | 10 | 6.542 μs | 0.0364 μs | 0.0340 μs | - | - | +| **HypEcs_MonoThread** | **100000** | **0** | **38.163 μs** | **0.1384 μs** | **0.1295 μs** | **-** | **72 B** | +| HypEcs_MultiThread | 100000 | 0 | 39.918 μs | 0.1703 μs | 0.1593 μs | 0.0610 | 1832 B | +| **HypEcs_MonoThread** | **100000** | **10** | **37.704 μs** | **0.1888 μs** | **0.1766 μs** | **-** | **72 B** | +| HypEcs_MultiThread | 100000 | 10 | 39.707 μs | 0.0574 μs | 0.0537 μs | 0.0610 | 1832 B | +| **LeopotamEcsLite** | **100000** | **0** | **111.991 μs** | **0.0742 μs** | **0.0694 μs** | **-** | **-** | +| **LeopotamEcsLite** | **100000** | **10** | **115.782 μs** | **0.4815 μs** | **0.4269 μs** | **-** | **-** | +| **LeopotamEcs** | **100000** | **0** | **83.299 μs** | **0.2362 μs** | **0.2094 μs** | **-** | **-** | +| **LeopotamEcs** | **100000** | **10** | **108.404 μs** | **0.6523 μs** | **0.6102 μs** | **-** | **-** | +| **MonoGameExtended** | **100000** | **0** | **253.155 μs** | **1.2699 μs** | **1.1879 μs** | **-** | **160 B** | +| **MonoGameExtended** | **100000** | **10** | **373.545 μs** | **2.6900 μs** | **2.5163 μs** | **-** | **160 B** | +| **Morpeh_Direct** | **100000** | **0** | **1,043.726 μs** | **1.7921 μs** | **1.3991 μs** | **-** | **2 B** | +| Morpeh_Stash | 100000 | 0 | 568.116 μs | 2.7533 μs | 2.5755 μs | - | 1 B | +| **Morpeh_Direct** | **100000** | **10** | **2,598.587 μs** | **21.9535 μs** | **18.3321 μs** | **-** | **3 B** | +| Morpeh_Stash | 100000 | 10 | 2,363.997 μs | 46.5325 μs | 97.1307 μs | - | 3 B | +| **Myriad_SingleThread** | **100000** | **0** | **51.304 μs** | **0.3245 μs** | **0.3035 μs** | **-** | **-** | +| Myriad_MultiThread | 100000 | 0 | 837.895 μs | 9.1105 μs | 8.5220 μs | 26.3672 | 442063 B | +| Myriad_SingleThreadChunk | 100000 | 0 | 23.897 μs | 0.1693 μs | 0.1584 μs | - | - | +| Myriad_MultiThreadChunk | 100000 | 0 | 21.416 μs | 0.0781 μs | 0.0731 μs | 0.3052 | 5411 B | +| Myriad_Enumerable | 100000 | 0 | 112.296 μs | 0.0674 μs | 0.0526 μs | - | - | +| Myriad_Delegate | 100000 | 0 | 67.135 μs | 0.1685 μs | 0.1576 μs | - | - | +| Myriad_SingleThreadChunk_SIMD | 100000 | 0 | 9.227 μs | 0.0440 μs | 0.0390 μs | - | - | +| **Myriad_SingleThread** | **100000** | **10** | **51.063 μs** | **0.1514 μs** | **0.1264 μs** | **-** | **-** | +| Myriad_MultiThread | 100000 | 10 | 885.890 μs | 6.8570 μs | 6.4140 μs | 26.3672 | 448585 B | +| Myriad_SingleThreadChunk | 100000 | 10 | 23.871 μs | 0.1273 μs | 0.1191 μs | - | - | +| Myriad_MultiThreadChunk | 100000 | 10 | 21.547 μs | 0.1076 μs | 0.1006 μs | 0.3052 | 5442 B | +| Myriad_Enumerable | 100000 | 10 | 111.324 μs | 0.8480 μs | 0.7932 μs | - | - | +| Myriad_Delegate | 100000 | 10 | 65.977 μs | 0.5311 μs | 0.4968 μs | - | - | +| Myriad_SingleThreadChunk_SIMD | 100000 | 10 | 8.868 μs | 0.0565 μs | 0.0529 μs | - | - | +| **RelEcs** | **100000** | **0** | **183.712 μs** | **0.2463 μs** | **0.2183 μs** | **-** | **120 B** | +| **RelEcs** | **100000** | **10** | **236.031 μs** | **1.6676 μs** | **1.5599 μs** | **-** | **120 B** | +| **SveltoECS** | **100000** | **0** | **108.539 μs** | **0.4489 μs** | **0.4199 μs** | **-** | **-** | +| **SveltoECS** | **100000** | **10** | **127.687 μs** | **0.5123 μs** | **0.4541 μs** | **-** | **-** | +| **TinyEcs_Each** | **100000** | **0** | **29.126 μs** | **0.1021 μs** | **0.0905 μs** | **-** | **-** | +| TinyEcs_EachJob | 100000 | 0 | 18.492 μs | 0.0376 μs | 0.0333 μs | 0.0916 | 1552 B | +| **TinyEcs_Each** | **100000** | **10** | **29.782 μs** | **0.1466 μs** | **0.1371 μs** | **-** | **-** | +| TinyEcs_EachJob | 100000 | 10 | 18.009 μs | 0.0492 μs | 0.0460 μs | 0.0916 | 1552 B | diff --git a/results/Ecs.CSharp.Benchmark.SystemWithThreeComponents-report-github.md b/results/Ecs.CSharp.Benchmark.SystemWithThreeComponents-report-github.md index bb50863..b008a3d 100644 --- a/results/Ecs.CSharp.Benchmark.SystemWithThreeComponents-report-github.md +++ b/results/Ecs.CSharp.Benchmark.SystemWithThreeComponents-report-github.md @@ -1,46 +1,75 @@ ``` -BenchmarkDotNet v0.13.12, Windows 10 (10.0.19045.3930/22H2/2022Update) -Intel Core i5-3570K CPU 3.40GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores -.NET SDK 8.0.101 - [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX - DefaultJob : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX +BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3447/23H2/2023Update/SunValley3) +AMD Ryzen 9 5900X, 1 CPU, 24 logical and 12 physical cores +.NET SDK 8.0.204 + [Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 + DefaultJob : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 ``` -| Method | EntityCount | EntityPadding | Mean | Error | StdDev | Gen0 | CacheMisses/Op | Allocated | -|-------------------------------- |------------ |-------------- |-------------:|----------:|---------:|-------:|---------------:|----------:| -| Arch_MonoThread | 100000 | 0 | 110.90 μs | 0.020 μs | 0.017 μs | - | 6 | - | -| Arch_MultiThread | 100000 | 0 | 40.42 μs | 0.033 μs | 0.029 μs | - | 4 | - | -| DefaultEcs_MonoThread | 100000 | 0 | 315.25 μs | 0.078 μs | 0.070 μs | - | 30 | 1 B | -| DefaultEcs_MultiThread | 100000 | 0 | 87.33 μs | 0.438 μs | 0.366 μs | - | 84 | - | -| FrifloEngineEcs_MonoThread | 100000 | 0 | 70.08 ns | 0.524 ns | 0.465 ns | 0.0535 | 0 | 168 B | -| FrifloEngineEcs_SIMD_MonoThread | 100000 | 0 | 68.65 ns | 0.072 ns | 0.064 ns | 0.0535 | 0 | 168 B | -| HypEcs_MonoThread | 100000 | 0 | 85.20 μs | 0.011 μs | 0.010 μs | - | 4 | 152 B | -| HypEcs_MultiThread | 100000 | 0 | 87.86 μs | 0.033 μs | 0.029 μs | 0.6104 | 16 | 1912 B | -| LeopotamEcs | 100000 | 0 | 337.48 μs | 0.068 μs | 0.060 μs | - | 15 | 1 B | -| LeopotamEcsLite | 100000 | 0 | 5,846.36 μs | 3.651 μs | 3.237 μs | - | 1,855 | 11 B | -| MonoGameExtended | 100000 | 0 | 1,078.86 μs | 0.869 μs | 0.679 μs | - | 36,031 | 163 B | -| Morpeh_Direct | 100000 | 0 | 6,529.41 μs | 8.381 μs | 7.840 μs | - | 8,788 | 22 B | -| Morpeh_Stash | 100000 | 0 | 3,111.72 μs | 1.814 μs | 1.608 μs | - | 9,658 | 6 B | -| RelEcs | 100000 | 0 | 903.30 μs | 3.331 μs | 2.953 μs | - | 35,170 | 217 B | -| SveltoECS | 100000 | 0 | 478.11 μs | 0.045 μs | 0.040 μs | - | 13 | 1 B | -| | | | | | | | | | -| Arch_MonoThread | 100000 | 10 | 111.05 μs | 0.013 μs | 0.012 μs | - | 6 | - | -| Arch_MultiThread | 100000 | 10 | 40.22 μs | 0.018 μs | 0.014 μs | - | 3 | - | -| DefaultEcs_MonoThread | 100000 | 10 | 1,087.29 μs | 0.407 μs | 0.381 μs | - | 52,219 | 3 B | -| DefaultEcs_MultiThread | 100000 | 10 | 966.01 μs | 0.827 μs | 0.774 μs | - | 123,190 | 1 B | -| FrifloEngineEcs_MonoThread | 100000 | 10 | 69.85 ns | 0.311 ns | 0.291 ns | 0.0535 | 0 | 168 B | -| FrifloEngineEcs_SIMD_MonoThread | 100000 | 10 | 71.10 ns | 1.438 ns | 1.476 ns | 0.0535 | 0 | 168 B | -| HypEcs_MonoThread | 100000 | 10 | 84.86 μs | 0.017 μs | 0.014 μs | - | 4 | 152 B | -| HypEcs_MultiThread | 100000 | 10 | 87.58 μs | 0.049 μs | 0.043 μs | 0.6104 | 15 | 1912 B | -| LeopotamEcs | 100000 | 10 | 503.75 μs | 0.354 μs | 0.276 μs | - | 1,841 | 1 B | -| LeopotamEcsLite | 100000 | 10 | 11,357.17 μs | 1.541 μs | 1.366 μs | - | 111,617 | 22 B | -| MonoGameExtended | 100000 | 10 | 3,491.99 μs | 8.411 μs | 7.456 μs | - | 242,196 | 166 B | -| Morpeh_Direct | 100000 | 10 | 9,850.22 μs | 6.149 μs | 5.135 μs | - | 204,342 | 22 B | -| Morpeh_Stash | 100000 | 10 | 8,283.08 μs | 10.876 μs | 8.491 μs | - | 186,510 | 22 B | -| RelEcs | 100000 | 10 | 2,236.64 μs | 5.558 μs | 4.641 μs | - | 164,969 | 222 B | -| SveltoECS | 100000 | 10 | NA | NA | NA | NA | NA | NA | +| Method | EntityCount | EntityPadding | Mean | Error | StdDev | Gen0 | Allocated | +|-------------------------------- |------------ |-------------- |--------------:|------------:|------------:|--------:|----------:| +| **Arch_MonoThread** | **100000** | **0** | **51.312 μs** | **0.1746 μs** | **0.1633 μs** | **-** | **-** | +| Arch_MonoThread_SourceGenerated | 100000 | 0 | 135.426 μs | 0.7392 μs | 0.6915 μs | - | - | +| Arch_MultiThread | 100000 | 0 | 61.860 μs | 0.5484 μs | 0.4861 μs | - | - | +| **Arch_MonoThread** | **100000** | **10** | **51.917 μs** | **0.2601 μs** | **0.2433 μs** | **-** | **-** | +| Arch_MonoThread_SourceGenerated | 100000 | 10 | 132.889 μs | 0.5659 μs | 0.5017 μs | - | - | +| Arch_MultiThread | 100000 | 10 | 62.934 μs | 0.1555 μs | 0.1455 μs | - | - | +| **DefaultEcs_MonoThread** | **100000** | **0** | **141.616 μs** | **0.4834 μs** | **0.4521 μs** | **-** | **-** | +| DefaultEcs_MultiThread | 100000 | 0 | 23.877 μs | 0.4733 μs | 1.1962 μs | - | - | +| **DefaultEcs_MonoThread** | **100000** | **10** | **200.186 μs** | **1.4024 μs** | **1.2432 μs** | **-** | **-** | +| DefaultEcs_MultiThread | 100000 | 10 | 124.775 μs | 3.2328 μs | 9.4812 μs | - | - | +| **Fennecs_ForEach** | **100000** | **0** | **64.932 μs** | **0.2310 μs** | **0.2161 μs** | **-** | **-** | +| Fennecs_Job | 100000 | 0 | 53.470 μs | 0.0625 μs | 0.0521 μs | - | - | +| Fennecs_Raw | 100000 | 0 | 65.706 μs | 0.3255 μs | 0.3044 μs | - | - | +| **Fennecs_ForEach** | **100000** | **10** | **66.105 μs** | **0.4139 μs** | **0.3872 μs** | **-** | **-** | +| Fennecs_Job | 100000 | 10 | 52.863 μs | 0.2107 μs | 0.1760 μs | - | - | +| Fennecs_Raw | 100000 | 10 | 58.360 μs | 0.3167 μs | 0.2963 μs | - | - | +| **FlecsNet_Each** | **100000** | **0** | **220.183 μs** | **0.5563 μs** | **0.4932 μs** | **-** | **-** | +| FlecsNet_Iter | 100000 | 0 | 76.079 μs | 0.5211 μs | 0.4874 μs | - | - | +| **FlecsNet_Each** | **100000** | **10** | **220.171 μs** | **0.8257 μs** | **0.7724 μs** | **-** | **-** | +| FlecsNet_Iter | 100000 | 10 | 76.728 μs | 0.5064 μs | 0.4736 μs | - | - | +| **FrifloEngineEcs_MonoThread** | **100000** | **0** | **44.047 μs** | **0.0196 μs** | **0.0184 μs** | **-** | **-** | +| FrifloEngineEcs_MultiThread | 100000 | 0 | 9.069 μs | 0.1813 μs | 0.3902 μs | - | - | +| FrifloEngineEcs_SIMD_MonoThread | 100000 | 0 | 10.892 μs | 0.0902 μs | 0.0844 μs | - | - | +| **FrifloEngineEcs_MonoThread** | **100000** | **10** | **44.123 μs** | **0.2317 μs** | **0.2167 μs** | **-** | **-** | +| FrifloEngineEcs_MultiThread | 100000 | 10 | 9.394 μs | 0.1873 μs | 0.4416 μs | - | - | +| FrifloEngineEcs_SIMD_MonoThread | 100000 | 10 | 15.325 μs | 0.0970 μs | 0.0860 μs | - | - | +| **HypEcs_MonoThread** | **100000** | **0** | **44.443 μs** | **0.0336 μs** | **0.0298 μs** | **-** | **152 B** | +| HypEcs_MultiThread | 100000 | 0 | 46.400 μs | 0.1984 μs | 0.1855 μs | 0.0610 | 1912 B | +| **HypEcs_MonoThread** | **100000** | **10** | **44.014 μs** | **0.1709 μs** | **0.1598 μs** | **-** | **152 B** | +| HypEcs_MultiThread | 100000 | 10 | 45.973 μs | 0.1279 μs | 0.1134 μs | 0.0610 | 1912 B | +| **LeopotamEcsLite** | **100000** | **0** | **234.923 μs** | **0.3499 μs** | **0.3102 μs** | **-** | **-** | +| **LeopotamEcsLite** | **100000** | **10** | **255.790 μs** | **1.4324 μs** | **1.3398 μs** | **-** | **-** | +| **LeopotamEcs** | **100000** | **0** | **184.047 μs** | **0.6701 μs** | **0.6268 μs** | **-** | **-** | +| **LeopotamEcs** | **100000** | **10** | **188.907 μs** | **0.1643 μs** | **0.1537 μs** | **-** | **-** | +| **MonoGameExtended** | **100000** | **0** | **389.794 μs** | **0.5178 μs** | **0.4324 μs** | **-** | **160 B** | +| **MonoGameExtended** | **100000** | **10** | **1,683.746 μs** | **16.1521 μs** | **14.3184 μs** | **-** | **162 B** | +| **Morpeh_Direct** | **100000** | **0** | **2,346.662 μs** | **11.5682 μs** | **10.2549 μs** | **-** | **3 B** | +| Morpeh_Stash | 100000 | 0 | 985.408 μs | 6.7968 μs | 6.0252 μs | - | 2 B | +| **Morpeh_Direct** | **100000** | **10** | **10,861.445 μs** | **216.9675 μs** | **222.8097 μs** | **-** | **12 B** | +| Morpeh_Stash | 100000 | 10 | 5,924.703 μs | 117.4890 μs | 186.3500 μs | - | 6 B | +| **Myriad_SingleThread** | **100000** | **0** | **55.562 μs** | **0.3645 μs** | **0.3409 μs** | **-** | **-** | +| Myriad_MultiThread | 100000 | 0 | 1,094.648 μs | 8.2085 μs | 7.6782 μs | 29.2969 | 490610 B | +| Myriad_SingleThreadChunk | 100000 | 0 | 48.025 μs | 0.1803 μs | 0.1687 μs | - | - | +| Myriad_MultiThreadChunk | 100000 | 0 | 24.359 μs | 0.1054 μs | 0.0986 μs | 0.3052 | 5515 B | +| Myriad_Enumerable | 100000 | 0 | 245.209 μs | 1.3994 μs | 1.3090 μs | - | - | +| Myriad_Delegate | 100000 | 0 | 90.019 μs | 0.0242 μs | 0.0226 μs | - | - | +| **Myriad_SingleThread** | **100000** | **10** | **55.990 μs** | **0.1436 μs** | **0.1199 μs** | **-** | **-** | +| Myriad_MultiThread | 100000 | 10 | 1,082.971 μs | 12.5686 μs | 11.7567 μs | 29.2969 | 486218 B | +| Myriad_SingleThreadChunk | 100000 | 10 | 49.273 μs | 0.1084 μs | 0.1014 μs | - | - | +| Myriad_MultiThreadChunk | 100000 | 10 | 23.229 μs | 0.1185 μs | 0.1108 μs | 0.3052 | 5300 B | +| Myriad_Enumerable | 100000 | 10 | 249.347 μs | 1.7417 μs | 1.6292 μs | - | - | +| Myriad_Delegate | 100000 | 10 | 110.744 μs | 0.7938 μs | 0.7425 μs | - | - | +| **RelEcs** | **100000** | **0** | **247.398 μs** | **0.8236 μs** | **0.6877 μs** | **-** | **217 B** | +| **RelEcs** | **100000** | **10** | **365.176 μs** | **4.0811 μs** | **3.8175 μs** | **-** | **216 B** | +| **SveltoECS** | **100000** | **0** | **322.910 μs** | **3.0070 μs** | **2.8128 μs** | **-** | **-** | +| **SveltoECS** | **100000** | **10** | **NA** | **NA** | **NA** | **NA** | **NA** | +| **TinyEcs_Each** | **100000** | **0** | **39.623 μs** | **0.1942 μs** | **0.1817 μs** | **-** | **-** | +| TinyEcs_EachJob | 100000 | 0 | 20.120 μs | 0.0679 μs | 0.0635 μs | 0.0916 | 1560 B | +| **TinyEcs_Each** | **100000** | **10** | **41.753 μs** | **0.1086 μs** | **0.1016 μs** | **-** | **-** | +| TinyEcs_EachJob | 100000 | 10 | 19.772 μs | 0.1357 μs | 0.1133 μs | 0.0916 | 1560 B | Benchmarks with issues: SystemWithThreeComponents.SveltoECS: DefaultJob [EntityCount=100000, EntityPadding=10] diff --git a/results/Ecs.CSharp.Benchmark.SystemWithTwoComponents-report-github.md b/results/Ecs.CSharp.Benchmark.SystemWithTwoComponents-report-github.md index b2a20bd..a22b117 100644 --- a/results/Ecs.CSharp.Benchmark.SystemWithTwoComponents-report-github.md +++ b/results/Ecs.CSharp.Benchmark.SystemWithTwoComponents-report-github.md @@ -1,43 +1,74 @@ ``` -BenchmarkDotNet v0.13.12, Windows 10 (10.0.19045.3930/22H2/2022Update) -Intel Core i5-3570K CPU 3.40GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores -.NET SDK 8.0.101 - [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX - DefaultJob : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX +BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3447/23H2/2023Update/SunValley3) +AMD Ryzen 9 5900X, 1 CPU, 24 logical and 12 physical cores +.NET SDK 8.0.204 + [Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 + DefaultJob : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 ``` -| Method | EntityCount | EntityPadding | Mean | Error | StdDev | Gen0 | CacheMisses/Op | Allocated | -|-------------------------------- |------------ |-------------- |------------:|----------:|----------:|-------:|---------------:|----------:| -| Arch_MonoThread | 100000 | 0 | 174.10 μs | 0.072 μs | 0.060 μs | - | 6 | - | -| Arch_MultiThread | 100000 | 0 | 36.09 μs | 0.020 μs | 0.018 μs | - | 3 | - | -| DefaultEcs_MonoThread | 100000 | 0 | 200.28 μs | 0.024 μs | 0.021 μs | - | 8 | - | -| DefaultEcs_MultiThread | 100000 | 0 | 53.54 μs | 0.083 μs | 0.074 μs | - | 32 | - | -| FrifloEngineEcs_MonoThread | 100000 | 0 | 84.63 μs | 0.098 μs | 0.092 μs | - | 3 | 216 B | -| FrifloEngineEcs_SIMD_MonoThread | 100000 | 0 | 32.38 μs | 0.002 μs | 0.001 μs | 0.0610 | 3 | 216 B | -| HypEcs_MonoThread | 100000 | 0 | 57.90 μs | 0.007 μs | 0.006 μs | - | 2 | 112 B | -| HypEcs_MultiThread | 100000 | 0 | 60.35 μs | 0.036 μs | 0.030 μs | 0.4883 | 13 | 1872 B | -| LeopotamEcs | 100000 | 0 | 231.52 μs | 0.033 μs | 0.028 μs | - | 6 | - | -| LeopotamEcsLite | 100000 | 0 | 3,865.86 μs | 1.004 μs | 0.890 μs | - | 607 | 6 B | -| MonoGameExtended | 100000 | 0 | 827.06 μs | 0.933 μs | 0.779 μs | - | 23,761 | 161 B | -| Morpeh_Direct | 100000 | 0 | 4,653.57 μs | 2.505 μs | 2.220 μs | - | 6,937 | 11 B | -| Morpeh_Stash | 100000 | 0 | 2,415.97 μs | 0.891 μs | 0.744 μs | - | 7,613 | 6 B | -| RelEcs | 100000 | 0 | 628.46 μs | 1.983 μs | 1.758 μs | - | 18,389 | 169 B | -| SveltoECS | 100000 | 0 | 309.20 μs | 0.047 μs | 0.042 μs | - | 12 | 1 B | -| | | | | | | | | | -| Arch_MonoThread | 100000 | 10 | 174.20 μs | 0.089 μs | 0.070 μs | - | 4 | - | -| Arch_MultiThread | 100000 | 10 | 35.99 μs | 0.019 μs | 0.017 μs | - | 2 | - | -| DefaultEcs_MonoThread | 100000 | 10 | 887.92 μs | 0.502 μs | 0.419 μs | - | 59,358 | 1 B | -| DefaultEcs_MultiThread | 100000 | 10 | 684.24 μs | 0.889 μs | 0.743 μs | - | 79,813 | 1 B | -| FrifloEngineEcs_MonoThread | 100000 | 10 | 85.35 μs | 0.197 μs | 0.184 μs | - | 3 | 216 B | -| FrifloEngineEcs_SIMD_MonoThread | 100000 | 10 | 39.45 μs | 0.007 μs | 0.006 μs | 0.0610 | 3 | 216 B | -| HypEcs_MonoThread | 100000 | 10 | 58.99 μs | 0.004 μs | 0.003 μs | - | 2 | 112 B | -| HypEcs_MultiThread | 100000 | 10 | 61.48 μs | 0.041 μs | 0.036 μs | 0.4883 | 13 | 1872 B | -| LeopotamEcs | 100000 | 10 | 241.93 μs | 0.063 μs | 0.056 μs | - | 152 | - | -| LeopotamEcsLite | 100000 | 10 | 8,285.54 μs | 3.982 μs | 3.530 μs | - | 110,260 | 22 B | -| MonoGameExtended | 100000 | 10 | 2,869.26 μs | 10.787 μs | 10.091 μs | - | 177,309 | 166 B | -| Morpeh_Direct | 100000 | 10 | 7,882.32 μs | 27.665 μs | 25.878 μs | - | 180,485 | 22 B | -| Morpeh_Stash | 100000 | 10 | 7,363.95 μs | 2.661 μs | 2.222 μs | - | 193,726 | 11 B | -| RelEcs | 100000 | 10 | 1,782.27 μs | 1.008 μs | 0.894 μs | - | 106,469 | 171 B | -| SveltoECS | 100000 | 10 | 1,868.02 μs | 0.625 μs | 0.554 μs | - | 600 | 3 B | +| Method | EntityCount | EntityPadding | Mean | Error | StdDev | Median | Gen0 | Allocated | +|-------------------------------- |------------ |-------------- |-------------:|------------:|------------:|-------------:|--------:|----------:| +| **Arch_MonoThread** | **100000** | **0** | **45.308 μs** | **0.1321 μs** | **0.1236 μs** | **45.357 μs** | **-** | **-** | +| Arch_MonoThread_SourceGenerated | 100000 | 0 | 28.794 μs | 0.0641 μs | 0.0600 μs | 28.780 μs | - | - | +| Arch_MultiThread | 100000 | 0 | 57.264 μs | 0.0820 μs | 0.0727 μs | 57.284 μs | - | - | +| **Arch_MonoThread** | **100000** | **10** | **44.605 μs** | **0.1348 μs** | **0.1195 μs** | **44.580 μs** | **-** | **-** | +| Arch_MonoThread_SourceGenerated | 100000 | 10 | 26.711 μs | 0.0862 μs | 0.0806 μs | 26.754 μs | - | - | +| Arch_MultiThread | 100000 | 10 | 50.987 μs | 0.0759 μs | 0.0710 μs | 50.990 μs | - | - | +| **DefaultEcs_MonoThread** | **100000** | **0** | **110.189 μs** | **0.1083 μs** | **0.0846 μs** | **110.165 μs** | **-** | **-** | +| DefaultEcs_MultiThread | 100000 | 0 | 16.247 μs | 0.3183 μs | 0.8215 μs | 16.251 μs | - | - | +| **DefaultEcs_MonoThread** | **100000** | **10** | **135.716 μs** | **0.7498 μs** | **0.6646 μs** | **135.416 μs** | **-** | **-** | +| DefaultEcs_MultiThread | 100000 | 10 | 35.017 μs | 2.4582 μs | 7.2481 μs | 31.295 μs | - | - | +| **Fennecs_ForEach** | **100000** | **0** | **44.249 μs** | **0.1188 μs** | **0.1111 μs** | **44.239 μs** | **-** | **-** | +| Fennecs_Job | 100000 | 0 | 50.736 μs | 0.1517 μs | 0.1419 μs | 50.701 μs | - | - | +| Fennecs_Raw | 100000 | 0 | 43.445 μs | 0.2540 μs | 0.2376 μs | 43.368 μs | - | - | +| **Fennecs_ForEach** | **100000** | **10** | **44.538 μs** | **0.1828 μs** | **0.1710 μs** | **44.423 μs** | **-** | **-** | +| Fennecs_Job | 100000 | 10 | 52.735 μs | 0.1195 μs | 0.1118 μs | 52.693 μs | - | - | +| Fennecs_Raw | 100000 | 10 | 43.897 μs | 0.1760 μs | 0.1647 μs | 44.017 μs | - | - | +| **FlecsNet_Each** | **100000** | **0** | **196.370 μs** | **6.1563 μs** | **17.8606 μs** | **205.352 μs** | **-** | **-** | +| FlecsNet_Iter | 100000 | 0 | 62.017 μs | 0.2624 μs | 0.2454 μs | 62.175 μs | - | - | +| **FlecsNet_Each** | **100000** | **10** | **209.933 μs** | **0.3426 μs** | **0.3037 μs** | **209.967 μs** | **-** | **-** | +| FlecsNet_Iter | 100000 | 10 | 58.021 μs | 0.1786 μs | 0.1671 μs | 57.961 μs | - | - | +| **FrifloEngineEcs_MonoThread** | **100000** | **0** | **45.461 μs** | **0.0433 μs** | **0.0384 μs** | **45.463 μs** | **-** | **-** | +| FrifloEngineEcs_MultiThread | 100000 | 0 | 8.368 μs | 0.1633 μs | 0.4414 μs | 8.299 μs | - | - | +| FrifloEngineEcs_SIMD_MonoThread | 100000 | 0 | 8.607 μs | 0.0673 μs | 0.0630 μs | 8.577 μs | - | - | +| **FrifloEngineEcs_MonoThread** | **100000** | **10** | **45.153 μs** | **0.1892 μs** | **0.1770 μs** | **45.226 μs** | **-** | **-** | +| FrifloEngineEcs_MultiThread | 100000 | 10 | 9.527 μs | 0.1904 μs | 0.5149 μs | 9.468 μs | - | - | +| FrifloEngineEcs_SIMD_MonoThread | 100000 | 10 | 7.623 μs | 0.0562 μs | 0.0526 μs | 7.651 μs | - | - | +| **HypEcs_MonoThread** | **100000** | **0** | **32.666 μs** | **0.0327 μs** | **0.0306 μs** | **32.664 μs** | **-** | **112 B** | +| HypEcs_MultiThread | 100000 | 0 | 34.746 μs | 0.1753 μs | 0.1640 μs | 34.782 μs | 0.0610 | 1872 B | +| **HypEcs_MonoThread** | **100000** | **10** | **32.622 μs** | **0.0259 μs** | **0.0202 μs** | **32.616 μs** | **-** | **112 B** | +| HypEcs_MultiThread | 100000 | 10 | 34.448 μs | 0.1456 μs | 0.1362 μs | 34.382 μs | 0.0610 | 1872 B | +| **LeopotamEcsLite** | **100000** | **0** | **155.337 μs** | **0.5269 μs** | **0.4928 μs** | **155.061 μs** | **-** | **-** | +| **LeopotamEcsLite** | **100000** | **10** | **182.237 μs** | **0.7044 μs** | **0.6589 μs** | **182.504 μs** | **-** | **-** | +| **LeopotamEcs** | **100000** | **0** | **125.247 μs** | **0.3801 μs** | **0.3555 μs** | **125.024 μs** | **-** | **-** | +| **LeopotamEcs** | **100000** | **10** | **133.385 μs** | **0.3853 μs** | **0.3604 μs** | **133.513 μs** | **-** | **-** | +| **MonoGameExtended** | **100000** | **0** | **300.108 μs** | **0.2923 μs** | **0.2734 μs** | **300.212 μs** | **-** | **160 B** | +| **MonoGameExtended** | **100000** | **10** | **852.321 μs** | **4.9836 μs** | **4.4179 μs** | **852.372 μs** | **-** | **161 B** | +| **Morpeh_Direct** | **100000** | **0** | **1,842.942 μs** | **33.9321 μs** | **31.7401 μs** | **1,826.033 μs** | **-** | **2 B** | +| Morpeh_Stash | 100000 | 0 | 836.561 μs | 3.4551 μs | 3.2319 μs | 837.310 μs | - | 1 B | +| **Morpeh_Direct** | **100000** | **10** | **8,316.462 μs** | **162.6014 μs** | **159.6963 μs** | **8,275.210 μs** | **-** | **12 B** | +| Morpeh_Stash | 100000 | 10 | 5,149.691 μs | 61.1528 μs | 54.2104 μs | 5,141.828 μs | - | 6 B | +| **Myriad_SingleThread** | **100000** | **0** | **54.268 μs** | **0.2890 μs** | **0.2703 μs** | **54.186 μs** | **-** | **-** | +| Myriad_MultiThread | 100000 | 0 | 982.415 μs | 9.8467 μs | 8.7288 μs | 981.153 μs | 27.3438 | 472799 B | +| Myriad_SingleThreadChunk | 100000 | 0 | 39.777 μs | 0.0425 μs | 0.0332 μs | 39.766 μs | - | - | +| Myriad_MultiThreadChunk | 100000 | 0 | 22.829 μs | 0.0459 μs | 0.0407 μs | 22.821 μs | 0.3052 | 5464 B | +| Myriad_Enumerable | 100000 | 0 | 234.799 μs | 1.2097 μs | 0.9445 μs | 235.036 μs | - | - | +| Myriad_Delegate | 100000 | 0 | 87.757 μs | 0.4011 μs | 0.3752 μs | 87.810 μs | - | - | +| Myriad_SingleThreadChunk_SIMD | 100000 | 0 | 12.391 μs | 0.0895 μs | 0.0837 μs | 12.427 μs | - | - | +| **Myriad_SingleThread** | **100000** | **10** | **55.081 μs** | **0.2631 μs** | **0.2461 μs** | **55.247 μs** | **-** | **-** | +| Myriad_MultiThread | 100000 | 10 | 946.951 μs | 8.1955 μs | 7.6660 μs | 944.439 μs | 27.3438 | 463045 B | +| Myriad_SingleThreadChunk | 100000 | 10 | 39.258 μs | 0.0601 μs | 0.0502 μs | 39.250 μs | - | - | +| Myriad_MultiThreadChunk | 100000 | 10 | 22.859 μs | 0.0877 μs | 0.0820 μs | 22.859 μs | 0.3052 | 5513 B | +| Myriad_Enumerable | 100000 | 10 | 240.305 μs | 1.1970 μs | 1.1197 μs | 239.568 μs | - | - | +| Myriad_Delegate | 100000 | 10 | 66.207 μs | 0.1047 μs | 0.0875 μs | 66.207 μs | - | - | +| Myriad_SingleThreadChunk_SIMD | 100000 | 10 | 12.521 μs | 0.0341 μs | 0.0302 μs | 12.507 μs | - | - | +| **RelEcs** | **100000** | **0** | **204.882 μs** | **0.3362 μs** | **0.2625 μs** | **204.820 μs** | **-** | **168 B** | +| **RelEcs** | **100000** | **10** | **294.985 μs** | **2.4805 μs** | **2.3202 μs** | **293.926 μs** | **-** | **168 B** | +| **SveltoECS** | **100000** | **0** | **217.040 μs** | **0.6910 μs** | **0.6463 μs** | **217.368 μs** | **-** | **-** | +| **SveltoECS** | **100000** | **10** | **1,304.605 μs** | **6.2746 μs** | **5.5623 μs** | **1,306.077 μs** | **-** | **2 B** | +| **TinyEcs_Each** | **100000** | **0** | **26.479 μs** | **0.0888 μs** | **0.0787 μs** | **26.512 μs** | **-** | **-** | +| TinyEcs_EachJob | 100000 | 0 | 18.590 μs | 0.1119 μs | 0.0992 μs | 18.573 μs | 0.0916 | 1552 B | +| **TinyEcs_Each** | **100000** | **10** | **26.613 μs** | **0.0838 μs** | **0.0784 μs** | **26.641 μs** | **-** | **-** | +| TinyEcs_EachJob | 100000 | 10 | 19.356 μs | 0.1512 μs | 0.1414 μs | 19.327 μs | 0.0916 | 1552 B | diff --git a/results/Ecs.CSharp.Benchmark.SystemWithTwoComponentsMultipleComposition-report-github.md b/results/Ecs.CSharp.Benchmark.SystemWithTwoComponentsMultipleComposition-report-github.md index ca901af..e878c29 100644 --- a/results/Ecs.CSharp.Benchmark.SystemWithTwoComponentsMultipleComposition-report-github.md +++ b/results/Ecs.CSharp.Benchmark.SystemWithTwoComponentsMultipleComposition-report-github.md @@ -1,27 +1,43 @@ ``` -BenchmarkDotNet v0.13.12, Windows 10 (10.0.19045.3930/22H2/2022Update) -Intel Core i5-3570K CPU 3.40GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores -.NET SDK 8.0.101 - [Host] : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX - DefaultJob : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX +BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3447/23H2/2023Update/SunValley3) +AMD Ryzen 9 5900X, 1 CPU, 24 logical and 12 physical cores +.NET SDK 8.0.204 + [Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 + DefaultJob : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2 ``` -| Method | EntityCount | Mean | Error | StdDev | Gen0 | CacheMisses/Op | Allocated | -|-------------------------------- |------------ |------------:|----------:|---------:|-------:|---------------:|----------:| -| Arch | 100000 | 90.87 μs | 0.012 μs | 0.011 μs | - | 2 | - | -| Arch_MultiThread | 100000 | 55.64 μs | 0.150 μs | 0.125 μs | - | 3 | - | -| DefaultEcs_MonoThread | 100000 | 197.71 μs | 0.017 μs | 0.016 μs | - | 5 | - | -| DefaultEcs_MultiThread | 100000 | 52.81 μs | 0.084 μs | 0.079 μs | - | 4 | - | -| FrifloEngineEcs_MonoThread | 100000 | 84.88 μs | 0.011 μs | 0.009 μs | - | 3 | 304 B | -| FrifloEngineEcs_SIMD_MonoThread | 100000 | 38.22 μs | 0.077 μs | 0.072 μs | 0.0610 | 3 | 304 B | -| HypEcs_MonoThread | 100000 | 58.38 μs | 0.042 μs | 0.035 μs | 0.0610 | 3 | 352 B | -| HypEcs_MultiThread | 100000 | 21.73 μs | 0.203 μs | 0.190 μs | 0.8545 | 11 | 2655 B | -| LeopotamEcs | 100000 | 235.56 μs | 0.027 μs | 0.022 μs | - | 5 | - | -| LeopotamEcsLite | 100000 | 3,703.18 μs | 1.449 μs | 1.210 μs | - | 594 | 7 B | -| MonoGameExtended | 100000 | 1,015.73 μs | 0.867 μs | 0.677 μs | - | 40,470 | 163 B | -| Morpeh_Direct | 100000 | 5,087.22 μs | 4.238 μs | 3.539 μs | - | 114,642 | 14 B | -| Morpeh_Stash | 100000 | 3,863.37 μs | 2.204 μs | 1.954 μs | - | 116,809 | 7 B | -| RelEcs | 100000 | 1,564.69 μs | 10.191 μs | 8.510 μs | - | 83,810 | 491 B | -| SveltoECS | 100000 | 309.39 μs | 0.029 μs | 0.028 μs | - | 7 | 1 B | +| Method | EntityCount | Mean | Error | StdDev | Gen0 | Allocated | +|-------------------------------- |------------ |-------------:|-----------:|-----------:|--------:|----------:| +| Arch | 100000 | 45.588 μs | 0.1667 μs | 0.1559 μs | - | - | +| Arch_MonoThread_SourceGenerated | 100000 | 28.864 μs | 0.1579 μs | 0.1477 μs | - | - | +| Arch_MultiThread | 100000 | 216.326 μs | 0.5008 μs | 0.4440 μs | - | - | +| DefaultEcs_MonoThread | 100000 | 111.634 μs | 0.3284 μs | 0.2742 μs | - | - | +| DefaultEcs_MultiThread | 100000 | 17.336 μs | 0.3461 μs | 0.7883 μs | - | - | +| Fennecs_ForEach | 100000 | 45.614 μs | 0.2717 μs | 0.2408 μs | - | - | +| Fennecs_Job | 100000 | 54.985 μs | 0.2037 μs | 0.1906 μs | - | - | +| Fennecs_Raw | 100000 | 44.672 μs | 0.2330 μs | 0.2179 μs | - | - | +| FlecsNet_Each | 100000 | 206.724 μs | 0.1604 μs | 0.1340 μs | - | - | +| FlecsNet_Iter | 100000 | 58.126 μs | 0.2896 μs | 0.2709 μs | - | - | +| FrifloEngineEcs_MonoThread | 100000 | 45.401 μs | 0.2362 μs | 0.2210 μs | - | - | +| FrifloEngineEcs_MultiThread | 100000 | 21.822 μs | 0.4332 μs | 0.9865 μs | - | - | +| FrifloEngineEcs_SIMD_MonoThread | 100000 | 9.130 μs | 0.0415 μs | 0.0388 μs | - | - | +| HypEcs_MonoThread | 100000 | 33.012 μs | 0.1804 μs | 0.1687 μs | - | 352 B | +| HypEcs_MultiThread | 100000 | 11.779 μs | 0.2332 μs | 0.3269 μs | 0.1678 | 2826 B | +| LeopotamEcsLite | 100000 | 155.412 μs | 0.0678 μs | 0.0566 μs | - | - | +| LeopotamEcs | 100000 | 124.123 μs | 0.5376 μs | 0.5029 μs | - | - | +| MonoGameExtended | 100000 | 301.107 μs | 1.1098 μs | 1.0381 μs | - | 160 B | +| Morpeh_Direct | 100000 | 1,518.622 μs | 12.8902 μs | 11.4268 μs | - | 2 B | +| Morpeh_Stash | 100000 | 862.835 μs | 6.9734 μs | 6.5229 μs | - | 1 B | +| Myriad_SingleThread | 100000 | 54.953 μs | 0.1963 μs | 0.1836 μs | - | - | +| Myriad_MultiThread | 100000 | 985.841 μs | 11.6655 μs | 10.3412 μs | 27.3438 | 477241 B | +| Myriad_SingleThreadChunk | 100000 | 40.976 μs | 0.0664 μs | 0.0621 μs | - | - | +| Myriad_MultiThreadChunk | 100000 | 54.084 μs | 0.2846 μs | 0.2662 μs | 1.1597 | 19365 B | +| Myriad_Enumerable | 100000 | 241.300 μs | 1.0985 μs | 1.0275 μs | - | - | +| Myriad_Delegate | 100000 | 67.886 μs | 0.2847 μs | 0.2663 μs | - | - | +| Myriad_SingleThreadChunk_SIMD | 100000 | 12.698 μs | 0.0903 μs | 0.0845 μs | - | - | +| RelEcs | 100000 | 327.387 μs | 5.8896 μs | 5.2210 μs | - | 488 B | +| SveltoECS | 100000 | 195.377 μs | 0.8974 μs | 0.8394 μs | - | - | +| TinyEcs_Each | 100000 | 26.289 μs | 0.0748 μs | 0.0699 μs | - | - | +| TinyEcs_EachJob | 100000 | 18.676 μs | 0.0448 μs | 0.0397 μs | 0.1221 | 2080 B | From abf40f997d78b18cda2959fadc79995d86ccf41a Mon Sep 17 00:00:00 2001 From: Paillat Laszlo Date: Mon, 6 May 2024 18:55:34 +0200 Subject: [PATCH 11/12] cleanup results in readme --- README.md | 116 ++++++++++++++++++++---------------------------------- 1 file changed, 42 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index ed39375..8b29ac5 100644 --- a/README.md +++ b/README.md @@ -99,51 +99,39 @@ Modify entities with one component. The padding aims to simulate real situation | Method | EntityPadding | Mean | StdDev | Allocated | |--------------------------------------- |-------------- |-------------:|-----------:|----------:| -| **Arch_MonoThread** | **0** | **23.420 μs** | **0.0915 μs** | **-** | +| Arch_MonoThread | 0 | 23.420 μs | 0.0915 μs | - | | Arch_MonoThread_SourceGenerated | 0 | 23.251 μs | 0.0572 μs | - | | Arch_MultiThread | 0 | 49.880 μs | 0.1314 μs | - | -| **DefaultEcs_ComponentSystem_MonoThread** | **0** | **21.602 μs** | **0.0286 μs** | **-** | +| DefaultEcs_ComponentSystem_MonoThread | 0 | 21.602 μs | 0.0286 μs | - | | DefaultEcs_ComponentSystem_MultiThread | 0 | 5.319 μs | 0.2135 μs | - | | DefaultEcs_EntitySetSystem_MonoThread | 0 | 95.132 μs | 0.4925 μs | - | | DefaultEcs_EntitySetSystem_MultiThread | 0 | 11.450 μs | 0.3505 μs | - | -| **Fennecs_ForEach** | **0** | **21.648 μs** | **0.0110 μs** | **-** | +| Fennecs_ForEach | 0 | 21.648 μs | 0.0110 μs | - | | Fennecs_Job | 0 | 53.325 μs | 0.1703 μs | - | | Fennecs_Raw | 0 | 43.673 μs | 0.4105 μs | - | -| **FlecsNet_Each** | **0** | **71.867 μs** | **0.8808 μs** | **-** | +| FlecsNet_Each | 0 | 71.867 μs | 0.8808 μs | - | | FlecsNet_Iter | 0 | 50.694 μs | 0.0579 μs | - | -| **FrifloEngineEcs_MonoThread** | **0** | **21.537 μs** | **0.0918 μs** | **-** | +| FrifloEngineEcs_MonoThread | 0 | 21.537 μs | 0.0918 μs | - | | FrifloEngineEcs_MultiThread | 0 | 5.991 μs | 0.2777 μs | - | | FrifloEngineEcs_SIMD_MonoThread | 0 | 6.411 μs | 0.0190 μs | - | -| **HypEcs_MonoThread** | **0** | **38.163 μs** | **0.1295 μs** | **72 B** | +| HypEcs_MonoThread | 0 | 38.163 μs | 0.1295 μs | 72 B | | HypEcs_MultiThread | 0 | 39.918 μs | 0.1593 μs | 1832 B | -| **LeopotamEcsLite** | **0** | **111.991 μs** | **0.0694 μs** | **-** | -| **LeopotamEcs** | **0** | **83.299 μs** | **0.2094 μs** | **-** | -| **MonoGameExtended** | **0** | **253.155 μs** | **1.1879 μs** | **160 B** | -| **Morpeh_Direct** | **0** | **1,043.726 μs** | **1.3991 μs** | **2 B** | +| LeopotamEcsLite | 0 | 111.991 μs | 0.0694 μs | - | +| LeopotamEcs | 0 | 83.299 μs | 0.2094 μs | - | +| MonoGameExtended | 0 | 253.155 μs | 1.1879 μs | 160 B | +| Morpeh_Direct | 0 | 1,043.726 μs | 1.3991 μs | 2 B | | Morpeh_Stash | 0 | 568.116 μs | 2.5755 μs | 1 B | -| **Myriad_SingleThread** | **0** | **51.304 μs** | **0.3035 μs** | **-** | +| Myriad_SingleThread | 0 | 51.304 μs | 0.3035 μs | - | | Myriad_MultiThread | 0 | 837.895 μs | 8.5220 μs | 442063 B | | Myriad_SingleThreadChunk | 0 | 23.897 μs | 0.1584 μs | - | | Myriad_MultiThreadChunk | 0 | 21.416 μs | 0.0731 μs | 5411 B | | Myriad_Enumerable | 0 | 112.296 μs | 0.0526 μs | - | | Myriad_Delegate | 0 | 67.135 μs | 0.1576 μs | - | | Myriad_SingleThreadChunk_SIMD | 0 | 9.227 μs | 0.0390 μs | - | -| **RelEcs** | **0** | **183.712 μs** | **0.2183 μs** | **120 B** | -| **SveltoECS** | **0** | **108.539 μs** | **0.4199 μs** | **-** | -| **TinyEcs_Each** | **0** | **29.126 μs** | **0.0905 μs** | **-** | +| RelEcs | 0 | 183.712 μs | 0.2183 μs | 120 B | +| SveltoECS | 0 | 108.539 μs | 0.4199 μs | - | +| TinyEcs_Each | 0 | 29.126 μs | 0.0905 μs | - | | TinyEcs_EachJob | 0 | 18.492 μs | 0.0333 μs | 1552 B | -| | | | | | -| **DefaultEcs_ComponentSystem_MonoThread** | **10** | **21.527 μs** | **0.0964 μs** | **-** | -| DefaultEcs_ComponentSystem_MultiThread | 10 | 4.566 μs | 0.0886 μs | - | -| DefaultEcs_EntitySetSystem_MonoThread | 10 | 95.655 μs | 0.0378 μs | - | -| DefaultEcs_EntitySetSystem_MultiThread | 10 | 14.483 μs | 0.5477 μs | - | -| **LeopotamEcsLite** | **10** | **115.782 μs** | **0.4269 μs** | **-** | -| **LeopotamEcs** | **10** | **108.404 μs** | **0.6102 μs** | **-** | -| **MonoGameExtended** | **10** | **373.545 μs** | **2.5163 μs** | **160 B** | -| **Morpeh_Direct** | **10** | **2,598.587 μs** | **18.3321 μs** | **3 B** | -| Morpeh_Stash | 10 | 2,363.997 μs | 97.1307 μs | 3 B | -| **RelEcs** | **10** | **236.031 μs** | **1.5599 μs** | **120 B** | -| **SveltoECS** | **10** | **127.687 μs** | **0.4541 μs** | **-** | ## [SystemWithTwoComponents](results/Ecs.CSharp.Benchmark.SystemWithTwoComponents-report-github.md) @@ -151,93 +139,73 @@ Modify entities with two components. The padding aims to simulate real situation | Method | EntityPadding | Mean | StdDev | Allocated | |-------------------------------- |-------------- |-------------:|------------:|----------:| -| **Arch_MonoThread** | **0** | **45.308 μs** | **0.1236 μs** | **-** | +| Arch_MonoThread | 0 | 45.308 μs | 0.1236 μs | - | | Arch_MonoThread_SourceGenerated | 0 | 28.794 μs | 0.0600 μs | - | | Arch_MultiThread | 0 | 57.264 μs | 0.0727 μs | - | -| **DefaultEcs_MonoThread** | **0** | **110.189 μs** | **0.0846 μs** | **-** | +| DefaultEcs_MonoThread | 0 | 110.189 μs | 0.0846 μs | - | | DefaultEcs_MultiThread | 0 | 16.247 μs | 0.8215 μs | - | -| **Fennecs_ForEach** | **0** | **44.249 μs** | **0.1111 μs** | **-** | +| Fennecs_ForEach | 0 | 44.249 μs | 0.1111 μs | - | | Fennecs_Job | 0 | 50.736 μs | 0.1419 μs | - | | Fennecs_Raw | 0 | 43.445 μs | 0.2376 μs | - | -| **FlecsNet_Each** | **0** | **196.370 μs** | **17.8606 μs** | **-** | +| FlecsNet_Each | 0 | 196.370 μs | 17.8606 μs | - | | FlecsNet_Iter | 0 | 62.017 μs | 0.2454 μs | - | -| **FrifloEngineEcs_MonoThread** | **0** | **45.461 μs** | **0.0384 μs** | **-** | +| FrifloEngineEcs_MonoThread | 0 | 45.461 μs | 0.0384 μs | - | | FrifloEngineEcs_MultiThread | 0 | 8.368 μs | 0.4414 μs | - | | FrifloEngineEcs_SIMD_MonoThread | 0 | 8.607 μs | 0.0630 μs | - | -| **HypEcs_MonoThread** | **0** | **32.666 μs** | **0.0306 μs** | **112 B** | +| HypEcs_MonoThread | 0 | 32.666 μs | 0.0306 μs | 112 B | | HypEcs_MultiThread | 0 | 34.746 μs | 0.1640 μs | 1872 B | -| **LeopotamEcsLite** | **0** | **155.337 μs** | **0.4928 μs** | **-** | -| **LeopotamEcs** | **0** | **125.247 μs** | **0.3555 μs** | **-** | -| **MonoGameExtended** | **0** | **300.108 μs** | **0.2734 μs** | **160 B** | -| **Morpeh_Direct** | **0** | **1,842.942 μs** | **31.7401 μs** | **2 B** | +| LeopotamEcsLite | 0 | 155.337 μs | 0.4928 μs | - | +| LeopotamEcs | 0 | 125.247 μs | 0.3555 μs | - | +| MonoGameExtended | 0 | 300.108 μs | 0.2734 μs | 160 B | +| Morpeh_Direct | 0 | 1,842.942 μs | 31.7401 μs | 2 B | | Morpeh_Stash | 0 | 836.561 μs | 3.2319 μs | 1 B | -| **Myriad_SingleThread** | **0** | **54.268 μs** | **0.2703 μs** | **-** | +| Myriad_SingleThread | 0 | 54.268 μs | 0.2703 μs | - | | Myriad_MultiThread | 0 | 982.415 μs | 8.7288 μs | 472799 B | | Myriad_SingleThreadChunk | 0 | 39.777 μs | 0.0332 μs | - | | Myriad_MultiThreadChunk | 0 | 22.829 μs | 0.0407 μs | 5464 B | | Myriad_Enumerable | 0 | 234.799 μs | 0.9445 μs | - | | Myriad_Delegate | 0 | 87.757 μs | 0.3752 μs | - | | Myriad_SingleThreadChunk_SIMD | 0 | 12.391 μs | 0.0837 μs | - | -| **RelEcs** | **0** | **204.882 μs** | **0.2625 μs** | **168 B** | -| **SveltoECS** | **0** | **217.040 μs** | **0.6463 μs** | **-** | -| **TinyEcs_Each** | **0** | **26.479 μs** | **0.0787 μs** | **-** | +| RelEcs | 0 | 204.882 μs | 0.2625 μs | 168 B | +| SveltoECS | 0 | 217.040 μs | 0.6463 μs | - | +| TinyEcs_Each | 0 | 26.479 μs | 0.0787 μs | - | | TinyEcs_EachJob | 0 | 18.590 μs | 0.0992 μs | 1552 B | -| | | | | | -| **DefaultEcs_MonoThread** | **10** | **135.716 μs** | **0.6646 μs** | **-** | -| DefaultEcs_MultiThread | 10 | 35.017 μs | 7.2481 μs | - | -| **LeopotamEcsLite** | **10** | **182.237 μs** | **0.6589 μs** | **-** | -| **LeopotamEcs** | **10** | **133.385 μs** | **0.3604 μs** | **-** | -| **MonoGameExtended** | **10** | **852.321 μs** | **4.4179 μs** | **161 B** | -| **Morpeh_Direct** | **10** | **8,316.462 μs** | **159.6963 μs** | **12 B** | -| Morpeh_Stash | 10 | 5,149.691 μs | 54.2104 μs | 6 B | -| **RelEcs** | **10** | **294.985 μs** | **2.3202 μs** | **168 B** | -| **SveltoECS** | **10** | **1,304.605 μs** | **5.5623 μs** | **2 B** | ## [SystemWithThreeComponents](results/Ecs.CSharp.Benchmark.SystemWithThreeComponents-report-github.md) Modify entities with three components. The padding aims to simulate real situation when processed entities and their components are not sequential. | Method | EntityPadding | Mean | StdDev | Allocated | |-------------------------------- |-------------- |--------------:|------------:|----------:| -| **Arch_MonoThread** | **0** | **51.312 μs** | **0.1633 μs** | **-** | +| Arch_MonoThread | 0 | 51.312 μs | 0.1633 μs | - | | Arch_MonoThread_SourceGenerated | 0 | 135.426 μs | 0.6915 μs | - | | Arch_MultiThread | 0 | 61.860 μs | 0.4861 μs | - | -| **DefaultEcs_MonoThread** | **0** | **141.616 μs** | **0.4521 μs** | **-** | +| DefaultEcs_MonoThread | 0 | 141.616 μs | 0.4521 μs | - | | DefaultEcs_MultiThread | 0 | 23.877 μs | 1.1962 μs | - | -| **Fennecs_ForEach** | **0** | **64.932 μs** | **0.2161 μs** | **-** | +| Fennecs_ForEach | 0 | 64.932 μs | 0.2161 μs | - | | Fennecs_Job | 0 | 53.470 μs | 0.0521 μs | - | | Fennecs_Raw | 0 | 65.706 μs | 0.3044 μs | - | -| **FlecsNet_Each** | **0** | **220.183 μs** | **0.4932 μs** | **-** | +| FlecsNet_Each | 0 | 220.183 μs | 0.4932 μs | - | | FlecsNet_Iter | 0 | 76.079 μs | 0.4874 μs | - | -| **FrifloEngineEcs_MonoThread** | **0** | **44.047 μs** | **0.0184 μs** | **-** | +| FrifloEngineEcs_MonoThread | 0 | 44.047 μs | 0.0184 μs | - | | FrifloEngineEcs_MultiThread | 0 | 9.069 μs | 0.3902 μs | - | | FrifloEngineEcs_SIMD_MonoThread | 0 | 10.892 μs | 0.0844 μs | - | -| **HypEcs_MonoThread** | **0** | **44.443 μs** | **0.0298 μs** | **152 B** | +| HypEcs_MonoThread | 0 | 44.443 μs | 0.0298 μs | 152 B | | HypEcs_MultiThread | 0 | 46.400 μs | 0.1855 μs | 1912 B | -| **LeopotamEcsLite** | **0** | **234.923 μs** | **0.3102 μs** | **-** | -| **LeopotamEcs** | **0** | **184.047 μs** | **0.6268 μs** | **-** | -| **MonoGameExtended** | **0** | **389.794 μs** | **0.4324 μs** | **160 B** | -| **Morpeh_Direct** | **0** | **2,346.662 μs** | **10.2549 μs** | **3 B** | +| LeopotamEcsLite | 0 | 234.923 μs | 0.3102 μs | - | +| LeopotamEcs | 0 | 184.047 μs | 0.6268 μs | - | +| MonoGameExtended | 0 | 389.794 μs | 0.4324 μs | 160 B | +| Morpeh_Direct | 0 | 2,346.662 μs | 10.2549 μs | 3 B | | Morpeh_Stash | 0 | 985.408 μs | 6.0252 μs | 2 B | -| **Myriad_SingleThread** | **0** | **55.562 μs** | **0.3409 μs** | **-** | +| Myriad_SingleThread | 0 | 55.562 μs | 0.3409 μs | - | | Myriad_MultiThread | 0 | 1,094.648 μs | 7.6782 μs | 490610 B | | Myriad_SingleThreadChunk | 0 | 48.025 μs | 0.1687 μs | - | | Myriad_MultiThreadChunk | 0 | 24.359 μs | 0.0986 μs | 5515 B | | Myriad_Enumerable | 0 | 245.209 μs | 1.3090 μs | - | | Myriad_Delegate | 0 | 90.019 μs | 0.0226 μs | - | -| **RelEcs** | **0** | **247.398 μs** | **0.6877 μs** | **217 B** | -| **SveltoECS** | **0** | **322.910 μs** | **2.8128 μs** | **-** | -| **TinyEcs_Each** | **0** | **39.623 μs** | **0.1817 μs** | **-** | +| RelEcs | 0 | 247.398 μs | 0.6877 μs | 217 B | +| SveltoECS | 0 | 322.910 μs | 2.8128 μs | - | +| TinyEcs_Each | 0 | 39.623 μs | 0.1817 μs | - | | TinyEcs_EachJob | 0 | 20.120 μs | 0.0635 μs | 1560 B | -| | | | | | -| **DefaultEcs_MonoThread** | **10** | **200.186 μs** | **1.2432 μs** | **-** | -| DefaultEcs_MultiThread | 10 | 124.775 μs | 9.4812 μs | - | -| **LeopotamEcsLite** | **10** | **255.790 μs** | **1.3398 μs** | **-** | -| **LeopotamEcs** | **10** | **188.907 μs** | **0.1537 μs** | **-** | -| **MonoGameExtended** | **10** | **1,683.746 μs** | **14.3184 μs** | **162 B** | -| **Morpeh_Direct** | **10** | **10,861.445 μs** | **222.8097 μs** | **12 B** | -| Morpeh_Stash | 10 | 5,924.703 μs | 186.3500 μs | 6 B | -| **RelEcs** | **10** | **365.176 μs** | **3.8175 μs** | **216 B** | -| **SveltoECS** | **10** | **NA** | **NA** | **NA** | ## [SystemWithTwoComponentsMultipleComposition](results/Ecs.CSharp.Benchmark.SystemWithTwoComponentsMultipleComposition-report-github.md) From d996c17f7a08dbd1015a8a361170e46f9002e071 Mon Sep 17 00:00:00 2001 From: Paillat Laszlo Date: Mon, 6 May 2024 19:01:10 +0200 Subject: [PATCH 12/12] cleanup readme correctly because I'm blind --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 8b29ac5..19fb4b6 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,18 @@ Modify entities with one component. The padding aims to simulate real situation | SveltoECS | 0 | 108.539 μs | 0.4199 μs | - | | TinyEcs_Each | 0 | 29.126 μs | 0.0905 μs | - | | TinyEcs_EachJob | 0 | 18.492 μs | 0.0333 μs | 1552 B | +| | | | | | +| DefaultEcs_ComponentSystem_MonoThread | 10 | 21.527 μs | 0.0964 μs | - | +| DefaultEcs_ComponentSystem_MultiThread | 10 | 4.566 μs | 0.0886 μs | - | +| DefaultEcs_EntitySetSystem_MonoThread | 10 | 95.655 μs | 0.0378 μs | - | +| DefaultEcs_EntitySetSystem_MultiThread | 10 | 14.483 μs | 0.5477 μs | - | +| LeopotamEcsLite | 10 | 115.782 μs | 0.4269 μs | - | +| LeopotamEcs | 10 | 108.404 μs | 0.6102 μs | - | +| MonoGameExtended | 10 | 373.545 μs | 2.5163 μs | 160 B | +| Morpeh_Direct | 10 | 2,598.587 μs | 18.3321 μs | 3 B | +| Morpeh_Stash | 10 | 2,363.997 μs | 97.1307 μs | 3 B | +| RelEcs | 10 | 236.031 μs | 1.5599 μs | 120 B | +| SveltoECS | 10 | 127.687 μs | 0.4541 μs | - | ## [SystemWithTwoComponents](results/Ecs.CSharp.Benchmark.SystemWithTwoComponents-report-github.md) @@ -170,6 +182,16 @@ Modify entities with two components. The padding aims to simulate real situation | SveltoECS | 0 | 217.040 μs | 0.6463 μs | - | | TinyEcs_Each | 0 | 26.479 μs | 0.0787 μs | - | | TinyEcs_EachJob | 0 | 18.590 μs | 0.0992 μs | 1552 B | +| | | | | | +| DefaultEcs_MonoThread | 10 | 135.716 μs | 0.6646 μs | - | +| DefaultEcs_MultiThread | 10 | 35.017 μs | 7.2481 μs | - | +| LeopotamEcsLite | 10 | 182.237 μs | 0.6589 μs | - | +| LeopotamEcs | 10 | 133.385 μs | 0.3604 μs | - | +| MonoGameExtended | 10 | 852.321 μs | 4.4179 μs | 161 B | +| Morpeh_Direct | 10 | 8,316.462 μs | 159.6963 μs | 12 B | +| Morpeh_Stash | 10 | 5,149.691 μs | 54.2104 μs | 6 B | +| RelEcs | 10 | 294.985 μs | 2.3202 μs | 168 B | +| SveltoECS | 10 | 1,304.605 μs | 5.5623 μs | 2 B | ## [SystemWithThreeComponents](results/Ecs.CSharp.Benchmark.SystemWithThreeComponents-report-github.md) Modify entities with three components. The padding aims to simulate real situation when processed entities and their components are not sequential. @@ -206,6 +228,16 @@ Modify entities with three components. The padding aims to simulate real situati | SveltoECS | 0 | 322.910 μs | 2.8128 μs | - | | TinyEcs_Each | 0 | 39.623 μs | 0.1817 μs | - | | TinyEcs_EachJob | 0 | 20.120 μs | 0.0635 μs | 1560 B | +| | | | | | +| DefaultEcs_MonoThread | 10 | 200.186 μs | 1.2432 μs | - | +| DefaultEcs_MultiThread | 10 | 124.775 μs | 9.4812 μs | - | +| LeopotamEcsLite | 10 | 255.790 μs | 1.3398 μs | - | +| LeopotamEcs | 10 | 188.907 μs | 0.1537 μs | - | +| MonoGameExtended | 10 | 1,683.746 μs | 14.3184 μs | 162 B | +| Morpeh_Direct | 10 | 10,861.445 μs | 222.8097 μs | 12 B | +| Morpeh_Stash | 10 | 5,924.703 μs | 186.3500 μs | 6 B | +| RelEcs | 10 | 365.176 μs | 3.8175 μs | 216 B | +| SveltoECS | 10 | NA | NA | NA | ## [SystemWithTwoComponentsMultipleComposition](results/Ecs.CSharp.Benchmark.SystemWithTwoComponentsMultipleComposition-report-github.md)