diff --git a/source/DefaultEcs.Benchmark/DefaultEcs.Benchmark.csproj b/source/DefaultEcs.Benchmark/DefaultEcs.Benchmark.csproj index bcf50a6a..51867193 100644 --- a/source/DefaultEcs.Benchmark/DefaultEcs.Benchmark.csproj +++ b/source/DefaultEcs.Benchmark/DefaultEcs.Benchmark.csproj @@ -1,7 +1,7 @@  latest - net472 + net48 true Debug;Release diff --git a/source/DefaultEcs.Benchmark/DefaultEcs/System.cs b/source/DefaultEcs.Benchmark/DefaultEcs/System.cs index d9abfc53..cc67ce95 100644 --- a/source/DefaultEcs.Benchmark/DefaultEcs/System.cs +++ b/source/DefaultEcs.Benchmark/DefaultEcs/System.cs @@ -20,7 +20,7 @@ public static void ProcessInParallel(this EntitySet set, EntitySetProcess action } [MemoryDiagnoser] - [SimpleJob(RunStrategy.Monitoring, launchCount: 1, warmupCount: 10, targetCount: 20, invocationCount: 1000)] + [SimpleJob(RunStrategy.Monitoring, launchCount: 1, warmupCount: 10, targetCount: 20, invocationCount: 100)] public class System { private struct Position @@ -59,18 +59,15 @@ public Test2System(World world, SystemRunner runner) protected override void Update(float state, ReadOnlySpan entities) { - for (int i = 0; i < entities.Length; i++) + foreach (ref readonly Entity entity in entities) { - Speed speed = entities[i].Get(); - ref Position position = ref entities[i].Get(); + Speed speed = entity.Get(); + ref Position position = ref entity.Get(); position.X += speed.X * state; position.Y += speed.Y * state; } } - - protected override void Update(float state, in Entity entity) - { } } private sealed class TestSystemTPL : ISystem diff --git a/source/DefaultEcs.Benchmark/Program.cs b/source/DefaultEcs.Benchmark/Program.cs index cf0d4115..8a4c5bf1 100644 --- a/source/DefaultEcs.Benchmark/Program.cs +++ b/source/DefaultEcs.Benchmark/Program.cs @@ -10,10 +10,10 @@ private static void Main() { //typeof(DefaultEcs.CreateEntity), //typeof(DefaultEcs.EntitySetFilter), - typeof(DefaultEcs.MultipleFilterImpact), + //typeof(DefaultEcs.MultipleFilterImpact), //typeof(DefaultEcs.EntitySetEnumeration), //typeof(DefaultEcs.EntitySetWithComponentEnumeration), - //typeof(DefaultEcs.System), + typeof(DefaultEcs.System), //typeof(DefaultEcs.Recorder), //typeof(DefaultEcs.Serialization), //typeof(Performance.SingleComponentEntityEnumeration),