Skip to content

Commit

Permalink
upped benchmark to net48
Browse files Browse the repository at this point in the history
  • Loading branch information
Doraku committed Aug 31, 2019
1 parent ee72a90 commit 176d963
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/DefaultEcs.Benchmark/DefaultEcs.Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<LangVersion>latest</LangVersion>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net48</TargetFramework>
<DefineConstants></DefineConstants>
<Optimize>true</Optimize>
<Configurations>Debug;Release</Configurations>
Expand Down
11 changes: 4 additions & 7 deletions source/DefaultEcs.Benchmark/DefaultEcs/System.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -59,18 +59,15 @@ public Test2System(World world, SystemRunner<float> runner)

protected override void Update(float state, ReadOnlySpan<Entity> entities)
{
for (int i = 0; i < entities.Length; i++)
foreach (ref readonly Entity entity in entities)
{
Speed speed = entities[i].Get<Speed>();
ref Position position = ref entities[i].Get<Position>();
Speed speed = entity.Get<Speed>();
ref Position position = ref entity.Get<Position>();

position.X += speed.X * state;
position.Y += speed.Y * state;
}
}

protected override void Update(float state, in Entity entity)
{ }
}

private sealed class TestSystemTPL : ISystem<float>
Expand Down
4 changes: 2 additions & 2 deletions source/DefaultEcs.Benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 176d963

Please sign in to comment.