Home

Awesome

ECS c# Benchmark

This repo contains benchmarks of some c# ECS frameworks. Feel free to add your own or correct usage of existing ones! Please make your framework available as a nuget package to ease referencing and updating versions.

The benchmarks are not representative of usage in real conditions but results can still be interesting to look at.

All results are obtained from the same toaster, with the same load, so comparison is fairer.

Tested frameworks:

Removed frameworks:

Tested versions may not be latest available, that's because I'm lazy and new versions may introduce breaking changes, so feel free to create pull requests to update libs you are knowledgeable about.

CreateEntityWithOneComponent

Create entities with one component.

MethodMeanStdDevAllocated
Arch7.039 ms0.0645 ms3178.16 KB
DefaultEcs11.389 ms0.1834 ms11321.11 KB
Fennecs10.429 ms0.3498 ms13636.45 KB
FlecsNet6.431 ms0.1844 ms2.73 KB
FrifloEngineEcs2.837 ms0.3247 ms5722.08 KB
LeopotamEcsLite3.608 ms0.2956 ms7151.08 KB
LeopotamEcs6.285 ms0.5788 ms13685.65 KB
MonoGameExtended8.255 ms1.5408 ms16408.89 KB
Morpeh_Direct58.202 ms8.1945 ms41305.76 KB
Morpeh_Stash45.100 ms4.1339 ms41305.76 KB
Myriad10.845 ms0.2996 ms6914.67 KB
HypEcs9.897 ms0.4462 ms25827.05 KB
RelEcs14.758 ms0.6834 ms29706.66 KB
SveltoECS21.747 ms1.0680 ms3.22 KB
TinyEcs7.454 ms0.1306 ms7834.44 KB

CreateEntityWithTwoComponents

Create entities with two components.

MethodMeanStdDevAllocated
Arch6.840 ms0.0855 ms3558.44 KB
DefaultEcs8.515 ms0.2086 ms15418.9 KB
Fennecs15.376 ms0.1575 ms15174.45 KB
FlecsNet11.082 ms0.0947 ms3.11 KB
FrifloEngineEcs2.522 ms0.1804 ms6236.16 KB
HypEcs18.703 ms0.3473 ms45334.39 KB
LeopotamEcsLite5.162 ms0.3004 ms9199.61 KB
LeopotamEcs6.982 ms0.4454 ms14711.02 KB
MonoGameExtended13.274 ms0.6977 ms23373.84 KB
Morpeh_Direct239.144 ms4.4908 ms128867.66 KB
Morpeh_Stash39.734 ms2.4779 ms48133.7 KB
Myriad15.280 ms0.1624 ms7309.77 KB
RelEcs36.776 ms0.6916 ms50749.86 KB
SveltoECS34.237 ms0.6508 ms4.14 KB
TinyEcs14.042 ms0.1360 ms13785.08 KB

CreateEntityWithThreeComponents

Create entities with three components.

MethodMeanStdDevAllocated
Arch3.316 ms0.0901 ms3947.67 KB
SveltoECS46.643 ms2.0437 ms4.64 KB
DefaultEcs10.885 ms0.4542 ms19516.68 KB
Fennecs24.621 ms0.2685 ms16713.12 KB
FlecsNet16.746 ms0.2291 ms3.48 KB
FrifloEngineEcs2.525 ms0.1481 ms6750.23 KB
HypEcs30.509 ms0.8438 ms68750.7 KB
LeopotamEcsLite5.995 ms0.5505 ms11248.14 KB
LeopotamEcs8.869 ms0.5571 ms15736.4 KB
MonoGameExtended21.133 ms0.9090 ms30154.05 KB
Morpeh_Direct147.879 ms2.6211 ms83802.09 KB
Morpeh_Stash52.206 ms1.7453 ms44724.3 KB
Myriad22.632 ms0.1896 ms7704.88 KB
RelEcs65.055 ms1.1498 ms75699.76 KB
TinyEcs23.599 ms0.1396 ms21314.25 KB

SystemWithOneComponent

Modify entities with one component. The padding aims to simulate real situation when processed entities and their components are not sequential.

Note: Padding tests were removed for libraries that use archetypes to save space as padding makes no difference in their results

MethodEntityPaddingMeanStdDevAllocated
Arch_MonoThread023.420 μs0.0915 μs-
Arch_MonoThread_SourceGenerated023.251 μs0.0572 μs-
Arch_MultiThread049.880 μs0.1314 μs-
DefaultEcs_ComponentSystem_MonoThread021.602 μs0.0286 μs-
DefaultEcs_ComponentSystem_MultiThread05.319 μs0.2135 μs-
DefaultEcs_EntitySetSystem_MonoThread095.132 μs0.4925 μs-
DefaultEcs_EntitySetSystem_MultiThread011.450 μs0.3505 μs-
Fennecs_ForEach021.648 μs0.0110 μs-
Fennecs_Job053.325 μs0.1703 μs-
Fennecs_Raw043.673 μs0.4105 μs-
FlecsNet_Each071.867 μs0.8808 μs-
FlecsNet_Iter050.694 μs0.0579 μs-
FrifloEngineEcs_MonoThread021.537 μs0.0918 μs-
FrifloEngineEcs_MultiThread05.991 μs0.2777 μs-
FrifloEngineEcs_SIMD_MonoThread06.411 μs0.0190 μs-
HypEcs_MonoThread038.163 μs0.1295 μs72 B
HypEcs_MultiThread039.918 μs0.1593 μs1832 B
LeopotamEcsLite0111.991 μs0.0694 μs-
LeopotamEcs083.299 μs0.2094 μs-
MonoGameExtended0253.155 μs1.1879 μs160 B
Morpeh_Direct01,043.726 μs1.3991 μs2 B
Morpeh_Stash0568.116 μs2.5755 μs1 B
Myriad_SingleThread051.304 μs0.3035 μs-
Myriad_MultiThread0837.895 μs8.5220 μs442063 B
Myriad_SingleThreadChunk023.897 μs0.1584 μs-
Myriad_MultiThreadChunk021.416 μs0.0731 μs5411 B
Myriad_Enumerable0112.296 μs0.0526 μs-
Myriad_Delegate067.135 μs0.1576 μs-
Myriad_SingleThreadChunk_SIMD09.227 μs0.0390 μs-
RelEcs0183.712 μs0.2183 μs120 B
SveltoECS0108.539 μs0.4199 μs-
TinyEcs_Each029.126 μs0.0905 μs-
TinyEcs_EachJob018.492 μs0.0333 μs1552 B
DefaultEcs_ComponentSystem_MonoThread1021.527 μs0.0964 μs-
DefaultEcs_ComponentSystem_MultiThread104.566 μs0.0886 μs-
DefaultEcs_EntitySetSystem_MonoThread1095.655 μs0.0378 μs-
DefaultEcs_EntitySetSystem_MultiThread1014.483 μs0.5477 μs-
LeopotamEcsLite10115.782 μs0.4269 μs-
LeopotamEcs10108.404 μs0.6102 μs-
MonoGameExtended10373.545 μs2.5163 μs160 B
Morpeh_Direct102,598.587 μs18.3321 μs3 B
Morpeh_Stash102,363.997 μs97.1307 μs3 B
RelEcs10236.031 μs1.5599 μs120 B
SveltoECS10127.687 μs0.4541 μs-

SystemWithTwoComponents

Modify entities with two components. The padding aims to simulate real situation when processed entities and their components are not sequential.

MethodEntityPaddingMeanStdDevAllocated
Arch_MonoThread045.308 μs0.1236 μs-
Arch_MonoThread_SourceGenerated028.794 μs0.0600 μs-
Arch_MultiThread057.264 μs0.0727 μs-
DefaultEcs_MonoThread0110.189 μs0.0846 μs-
DefaultEcs_MultiThread016.247 μs0.8215 μs-
Fennecs_ForEach044.249 μs0.1111 μs-
Fennecs_Job050.736 μs0.1419 μs-
Fennecs_Raw043.445 μs0.2376 μs-
FlecsNet_Each0196.370 μs17.8606 μs-
FlecsNet_Iter062.017 μs0.2454 μs-
FrifloEngineEcs_MonoThread045.461 μs0.0384 μs-
FrifloEngineEcs_MultiThread08.368 μs0.4414 μs-
FrifloEngineEcs_SIMD_MonoThread08.607 μs0.0630 μs-
HypEcs_MonoThread032.666 μs0.0306 μs112 B
HypEcs_MultiThread034.746 μs0.1640 μs1872 B
LeopotamEcsLite0155.337 μs0.4928 μs-
LeopotamEcs0125.247 μs0.3555 μs-
MonoGameExtended0300.108 μs0.2734 μs160 B
Morpeh_Direct01,842.942 μs31.7401 μs2 B
Morpeh_Stash0836.561 μs3.2319 μs1 B
Myriad_SingleThread054.268 μs0.2703 μs-
Myriad_MultiThread0982.415 μs8.7288 μs472799 B
Myriad_SingleThreadChunk039.777 μs0.0332 μs-
Myriad_MultiThreadChunk022.829 μs0.0407 μs5464 B
Myriad_Enumerable0234.799 μs0.9445 μs-
Myriad_Delegate087.757 μs0.3752 μs-
Myriad_SingleThreadChunk_SIMD012.391 μs0.0837 μs-
RelEcs0204.882 μs0.2625 μs168 B
SveltoECS0217.040 μs0.6463 μs-
TinyEcs_Each026.479 μs0.0787 μs-
TinyEcs_EachJob018.590 μs0.0992 μs1552 B
DefaultEcs_MonoThread10135.716 μs0.6646 μs-
DefaultEcs_MultiThread1035.017 μs7.2481 μs-
LeopotamEcsLite10182.237 μs0.6589 μs-
LeopotamEcs10133.385 μs0.3604 μs-
MonoGameExtended10852.321 μs4.4179 μs161 B
Morpeh_Direct108,316.462 μs159.6963 μs12 B
Morpeh_Stash105,149.691 μs54.2104 μs6 B
RelEcs10294.985 μs2.3202 μs168 B
SveltoECS101,304.605 μs5.5623 μs2 B

SystemWithThreeComponents

Modify entities with three components. The padding aims to simulate real situation when processed entities and their components are not sequential.

MethodEntityPaddingMeanStdDevAllocated
Arch_MonoThread051.312 μs0.1633 μs-
Arch_MonoThread_SourceGenerated0135.426 μs0.6915 μs-
Arch_MultiThread061.860 μs0.4861 μs-
DefaultEcs_MonoThread0141.616 μs0.4521 μs-
DefaultEcs_MultiThread023.877 μs1.1962 μs-
Fennecs_ForEach064.932 μs0.2161 μs-
Fennecs_Job053.470 μs0.0521 μs-
Fennecs_Raw065.706 μs0.3044 μs-
FlecsNet_Each0220.183 μs0.4932 μs-
FlecsNet_Iter076.079 μs0.4874 μs-
FrifloEngineEcs_MonoThread044.047 μs0.0184 μs-
FrifloEngineEcs_MultiThread09.069 μs0.3902 μs-
FrifloEngineEcs_SIMD_MonoThread010.892 μs0.0844 μs-
HypEcs_MonoThread044.443 μs0.0298 μs152 B
HypEcs_MultiThread046.400 μs0.1855 μs1912 B
LeopotamEcsLite0234.923 μs0.3102 μs-
LeopotamEcs0184.047 μs0.6268 μs-
MonoGameExtended0389.794 μs0.4324 μs160 B
Morpeh_Direct02,346.662 μs10.2549 μs3 B
Morpeh_Stash0985.408 μs6.0252 μs2 B
Myriad_SingleThread055.562 μs0.3409 μs-
Myriad_MultiThread01,094.648 μs7.6782 μs490610 B
Myriad_SingleThreadChunk048.025 μs0.1687 μs-
Myriad_MultiThreadChunk024.359 μs0.0986 μs5515 B
Myriad_Enumerable0245.209 μs1.3090 μs-
Myriad_Delegate090.019 μs0.0226 μs-
RelEcs0247.398 μs0.6877 μs217 B
SveltoECS0322.910 μs2.8128 μs-
TinyEcs_Each039.623 μs0.1817 μs-
TinyEcs_EachJob020.120 μs0.0635 μs1560 B
DefaultEcs_MonoThread10200.186 μs1.2432 μs-
DefaultEcs_MultiThread10124.775 μs9.4812 μs-
LeopotamEcsLite10255.790 μs1.3398 μs-
LeopotamEcs10188.907 μs0.1537 μs-
MonoGameExtended101,683.746 μs14.3184 μs162 B
Morpeh_Direct1010,861.445 μs222.8097 μs12 B
Morpeh_Stash105,924.703 μs186.3500 μs6 B
RelEcs10365.176 μs3.8175 μs216 B
SveltoECS10NANANA

SystemWithTwoComponentsMultipleComposition

Modify entities with two components while different entity compositions match the the components query.

MethodMeanStdDevAllocated
Arch45.588 μs0.1559 μs-
Arch_MonoThread_SourceGenerated28.864 μs0.1477 μs-
Arch_MultiThread216.326 μs0.4440 μs-
DefaultEcs_MonoThread111.634 μs0.2742 μs-
DefaultEcs_MultiThread17.336 μs0.7883 μs-
Fennecs_ForEach45.614 μs0.2408 μs-
Fennecs_Job54.985 μs0.1906 μs-
Fennecs_Raw44.672 μs0.2179 μs-
FlecsNet_Each206.724 μs0.1340 μs-
FlecsNet_Iter58.126 μs0.2709 μs-
FrifloEngineEcs_MonoThread45.401 μs0.2210 μs-
FrifloEngineEcs_MultiThread21.822 μs0.9865 μs-
FrifloEngineEcs_SIMD_MonoThread9.130 μs0.0388 μs-
HypEcs_MonoThread33.012 μs0.1687 μs352 B
HypEcs_MultiThread11.779 μs0.3269 μs2826 B
LeopotamEcsLite155.412 μs0.0566 μs-
LeopotamEcs124.123 μs0.5029 μs-
MonoGameExtended301.107 μs1.0381 μs160 B
Morpeh_Direct1,518.622 μs11.4268 μs2 B
Morpeh_Stash862.835 μs6.5229 μs1 B
Myriad_SingleThread54.953 μs0.1836 μs-
Myriad_MultiThread985.841 μs10.3412 μs477241 B
Myriad_SingleThreadChunk40.976 μs0.0621 μs-
Myriad_MultiThreadChunk54.084 μs0.2662 μs19365 B
Myriad_Enumerable241.300 μs1.0275 μs-
Myriad_Delegate67.886 μs0.2663 μs-
Myriad_SingleThreadChunk_SIMD12.698 μs0.0845 μs-
RelEcs327.387 μs5.2210 μs488 B
SveltoECS195.377 μs0.8394 μs-
TinyEcs_Each26.289 μs0.0699 μs-
TinyEcs_EachJob18.676 μs0.0397 μs2080 B

Other benchmarks

While we are only looking at c# libs here, you may want to check other benchmarks for different langage. This list is not exaustive obviously, feel free to open a MR to add more if you are interested.