Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark Results #29

Open
xentripetal opened this issue Dec 13, 2023 · 1 comment
Open

Benchmark Results #29

xentripetal opened this issue Dec 13, 2023 · 1 comment

Comments

@xentripetal
Copy link

I've been checking out murder and bang and I'm really impressed with the framework you all are building!

While I understand performance isn't a priority at this time, I wanted to share some results of benchmarking bang against some other C# ECS frameworks. This isn't intended as a complaint against bang, but just to give an initial reference for relative performance. Hopefully this can also provide a reference to see the performance improvements of bang in the future!

Benchmark based on Dorakus ECS Benchmark. You can see the actual source for these tests here

Runner Information

BenchmarkDotNet=v0.13.5, OS=macOS 14.1.1 (23B81) [Darwin 23.1.0]
Apple M1 Max, 1 CPU, 10 logical and 10 physical cores
.NET SDK=8.0.100
  [Host]     : .NET 8.0.0 (8.0.23.53103), Arm64 RyuJIT AdvSIMD
  Job-QTHMPO : .NET 8.0.0 (8.0.23.53103), Arm64 RyuJIT AdvSIMD

InvocationCount=1  UnrollFactor=1  

Entity Creation

Entity With One Component

Method EntityCount Mean Error StdDev Median Gen0 Gen1 Gen2 Allocated
Arch 100000 5.615 ms 0.3447 ms 1.0164 ms 6.084 ms 1000.0000 - - 8263944 B
Bang 100000 96.309 ms 1.6662 ms 1.4770 ms 96.028 ms 16000.0000 7000.0000 3000.0000 99666120 B
DefaultEcs 100000 8.567 ms 0.1384 ms 0.1847 ms 8.512 ms 3000.0000 3000.0000 1000.0000 11595840 B
FlecsNet 100000 11.463 ms 0.1581 ms 0.1401 ms 11.432 ms - - - -
LeopotamEcsLite 100000 6.143 ms 0.1175 ms 0.1444 ms 6.143 ms 3000.0000 3000.0000 1000.0000 8370816 B
LeopotamEcs 100000 5.487 ms 0.1014 ms 0.0948 ms 5.475 ms 1000.0000 1000.0000 - 14014440 B
HypEcs 100000 18.441 ms 0.3306 ms 0.2760 ms 18.369 ms 5000.0000 5000.0000 1000.0000 26449928 B
RelEcs 100000 16.643 ms 0.2453 ms 0.2726 ms 16.611 ms 5000.0000 5000.0000 1000.0000 30422640 B
SveltoECS 100000 20.992 ms 0.4185 ms 0.5293 ms 20.913 ms - - - -

Entity With Two Components

Method EntityCount Mean Error StdDev Gen0 Gen1 Gen2 Allocated
Arch 100000 6.812 ms 0.0701 ms 0.0656 ms 1000.0000 - - 8630152 B
Bang 100000 107.020 ms 2.0466 ms 2.5883 ms 17000.0000 7000.0000 2000.0000 107662576 B
DefaultEcs 100000 9.363 ms 0.1826 ms 0.3101 ms 7000.0000 7000.0000 2000.0000 15794656 B
FlecsNet 100000 24.427 ms 0.3035 ms 0.2839 ms - - - -
HypEcs 100000 14.808 ms 0.2238 ms 0.1984 ms 6000.0000 2000.0000 2000.0000 46428128 B
LeopotamEcsLite 100000 10.513 ms 0.2089 ms 0.2997 ms 6000.0000 6000.0000 1000.0000 10468928 B
LeopotamEcs 100000 9.982 ms 0.1912 ms 0.1789 ms 2000.0000 2000.0000 - 15064424 B
RelEcs 100000 33.353 ms 0.4861 ms 0.4547 ms 8000.0000 3000.0000 3000.0000 51977304 B
SveltoECS 100000 35.009 ms 0.5993 ms 0.5606 ms - - - -

Entity With Three Components

Method EntityCount Mean Error StdDev Gen0 Gen1 Gen2 Allocated
Arch 100000 6.725 ms 0.0744 ms 0.0696 ms 1000.0000 - - 9036432 B
Bang 100000 126.838 ms 2.2920 ms 2.1439 ms 20000.0000 9000.0000 3000.0000 115669344 B
SveltoECS 100000 47.229 ms 0.5751 ms 0.5379 ms - - - -
DefaultEcs 100000 11.425 ms 0.2273 ms 0.4941 ms 7000.0000 7000.0000 2000.0000 19990768 B
FlecsNet 100000 36.148 ms 0.7114 ms 0.8998 ms - - - -
HypEcs 100000 26.855 ms 0.3674 ms 0.3068 ms 10000.0000 3000.0000 3000.0000 70406752 B
LeopotamEcsLite 100000 14.153 ms 0.3247 ms 0.9212 ms 7000.0000 7000.0000 2000.0000 12569704 B
LeopotamEcs 100000 10.476 ms 0.2086 ms 0.2232 ms 2000.0000 2000.0000 1000.0000 16117096 B
RelEcs 100000 60.164 ms 1.1787 ms 1.4031 ms 11000.0000 4000.0000 3000.0000 77524904 B

System Execution

System With One Component (RW)

Method EntityCount EntityPadding Mean Error StdDev Median Gen0 Gen1 Allocated
Arch_MonoThread 100000 0 56.45 μs 0.490 μs 0.127 μs 56.42 μs - - -
Arch_MultiThread 100000 0 79.71 μs 5.844 μs 3.866 μs 79.66 μs - - -
Arch_MonoThread 100000 10 56.16 μs 0.114 μs 0.030 μs 56.15 μs - - -
Arch_MultiThread 100000 10 74.40 μs 1.467 μs 0.227 μs 74.44 μs - - -
Bang 100000 0 54,047.73 μs 364.353 μs 94.621 μs 54,030.26 μs 2100.0000 400.0000 13600163 B
Bang 100000 10 198,366.91 μs 3,801.301 μs 2,514.325 μs 197,783.84 μs 2000.0000 333.3333 13600413 B
DefaultEcs_ComponentSystem_MonoThread 100000 0 53.38 μs 0.238 μs 0.062 μs 53.41 μs - - -
DefaultEcs_ComponentSystem_MultiThread 100000 0 312.69 μs 877.621 μs 522.258 μs 40.22 μs - - -
DefaultEcs_EntitySetSystem_MonoThread 100000 0 74.85 μs 0.236 μs 0.061 μs 74.82 μs - - -
DefaultEcs_EntitySetSystem_MultiThread 100000 0 53.55 μs 6.892 μs 4.559 μs 51.93 μs - - -
DefaultEcs_ComponentSystem_MonoThread 100000 10 53.42 μs 0.472 μs 0.123 μs 53.37 μs - - -
DefaultEcs_ComponentSystem_MultiThread 100000 10 441.01 μs 760.863 μs 452.777 μs 263.60 μs - - -
DefaultEcs_EntitySetSystem_MonoThread 100000 10 88.36 μs 1.335 μs 0.207 μs 88.34 μs - - -
DefaultEcs_EntitySetSystem_MultiThread 100000 10 390.52 μs 387.613 μs 230.663 μs 367.88 μs - - -
FlecsNet_WorldQuery 100000 0 504.17 μs 7.904 μs 2.053 μs 505.02 μs - - -
FlecsNet_Routine 100000 0 9,612.43 μs 98.278 μs 25.522 μs 9,621.15 μs - - -
FlecsNet_InstancedQuery 100000 0 2,740.05 μs 36.990 μs 13.191 μs 2,740.81 μs - - -
FlecsNet_WorldQuery 100000 10 516.19 μs 8.024 μs 2.861 μs 515.92 μs - - -
FlecsNet_Routine 100000 10 9,358.71 μs 151.171 μs 39.259 μs 9,378.96 μs - - -
FlecsNet_InstancedQuery 100000 10 2,829.77 μs 42.530 μs 18.883 μs 2,826.45 μs - - -
HypEcs_MonoThread 100000 0 62.13 μs 0.615 μs 0.160 μs 62.09 μs - - 32 B
HypEcs_MultiThread 100000 0 66.63 μs 1.585 μs 0.943 μs 66.75 μs 0.2441 - 2005 B
HypEcs_MonoThread 100000 10 61.50 μs 1.073 μs 0.561 μs 61.45 μs - - 32 B
HypEcs_MultiThread 100000 10 65.33 μs 0.955 μs 0.500 μs 65.20 μs 0.2441 - 2002 B
LeopotamEcsLite 100000 0 998.93 μs 18.560 μs 6.619 μs 997.65 μs - - -
LeopotamEcsLite 100000 10 2,016.08 μs 149.019 μs 88.679 μs 1,999.13 μs - - -
LeopotamEcs 100000 0 80.86 μs 0.498 μs 0.178 μs 80.85 μs - - -
LeopotamEcs 100000 10 80.87 μs 1.588 μs 0.566 μs 80.78 μs - - -
RelEcs 100000 0 203.80 μs 3.692 μs 1.316 μs 204.23 μs - - 120 B
RelEcs 100000 10 593.53 μs 8.628 μs 2.241 μs 593.77 μs - - 121 B
SveltoECS 100000 0 55.77 μs 0.111 μs 0.017 μs 55.76 μs - - -
SveltoECS 100000 10 55.75 μs 0.206 μs 0.054 μs 55.73 μs - - -
@isadorasophia
Copy link
Owner

This is great! Thank you for setting this up :) I think there's a lot of room of performance improvements to Bang, this is a great starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants