README.md

June 1, 2016 ยท View on GitHub

entity-system-benchmarks

Benchmarks description:

Tested frameworks

Benchmarks explained

  • All benchmarks measure throughput; higher score is better.
  • Attempt to be as similar as possible across frameworks.
  • Run with entityCount: 1024, 4096, 16384 and 65536.
  • Share the same random seed.
  • Raw, unprocessed results, here: https://github.com/junkdog/entity-system-benchmarks/tree/master/results
  • Additional data:
    • OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu1)
    • Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz

Component iteration benchmarks:

  • Have 3 entity systems updating a position component.
  • An Entity Deleter system: each 100th tick an entity is deleted and a new entity is created the next tick.
  • There are 3 types of iteration benchmarks:
    • baseline: position isn't updated, not included in charts.
    • plain: position component is the default component type.
    • pooled: pooling all components.

Insert/remove benchmarks:

  • Chooses from up to 144 different entity compositions.
  • Each tick, removes/inserts 1/4 of the total entityCount.
  • When creating entities, a random composition is selected.
    • The composition is randomly chosen, but shared across all frameworks/benchmarks.

Add/remove components benchmarks:

  • Have 3 BaselinePositionSystems.
  • Each tick, toggles the Position component for 1/4 all entities.
    • Entities are chosen from a pre-shuffled list of entity ids.
  • Two types of benchmarks:
    • entity_edit: Toggling achieve by calling entity.edit().create/remove
    • transmuter: Toggles using the EntityTransmuter class.

Benchmark results

As usual, writing microbenchmarks is tricky business - take the numbers with a grain of salt. These benchmarks should not be interpreted as benchmarking each framework as a whole, though they aim to give a hint of each framework's performance.

Things that might concern

  • Overall, ashley-realted benchmarks may be improved; I'm not very familiar with the framework.
  • I never got pooling working with Ashley-1.2.0. Ashley-1.0.1:s pooling benchmarks had an error, but considering it's now so old, I'd rather fix the benchmark for the most recent version.
  • artemis-odb's PackedComponent benchmarks only have a single component implementation, skewing the benchmark results in its favor.

artemis-odb_fast benchmarks

Artemis-odb-0.7.0 added support for automatically rewriting the generated class files of EntitySystems in order to achieve higher performance. The source code itself remains identical. More about it on the artemis-odb wiki: Hotspot Optimization.

Benchmarks: 4096 entites

it4k ir4k arc4k

ECSbaselineplainpooledinsert/removeedittransmute
artemis-odb-0.4.010609.166673.70774.12
artemis-odb-0.9.011776.1310949.4611476.163219.625435.996912.18
artemis-odb-0.9.0_fast13440.4311988.6612502.183245.355566.497144.00
artemis-odb-1.0.112395.2410373.8911563.603060.747827.039362.37
artemis-odb-1.0.1_fast15000.3911546.2612953.153172.147995.4810208.75
artemis-odb-2.0.0-RC112442.5811098.0312209.976217.788585.0910495.03
artemis-odb-2.0.0-RC1_fast15010.3911920.9913146.796225.459274.8311296.83
artemis-odb-2.0.0-RC212426.6711093.0712232.796101.398692.1610723.12
artemis-odb-2.0.0-RC2_fast15061.0512022.8613247.546300.219326.6311568.29
ashley-1.6.09621.744992.191710.13
gdx-artemis-0.5.09974.367545.311545.58
retinazer-0.2.019965.9810485.848589.6021339.54

Benchmarks: 16384 entites

it16k ir16k arc16k

ECSbaselineplainpooledinsert/removeedittransmute
artemis-odb-0.4.02613.932027.73156.16
artemis-odb-0.9.02945.442867.712871.12519.201248.991523.36
artemis-odb-0.9.0_fast3361.413115.783098.69521.041273.501578.94
artemis-odb-1.0.13111.222915.282950.20536.951831.172424.73
artemis-odb-1.0.1_fast3762.553199.093292.84541.522012.892614.00
artemis-odb-2.0.0-RC13052.383036.993088.561495.832109.252620.57
artemis-odb-2.0.0-RC1_fast3768.353256.183282.561513.292299.332805.50
artemis-odb-2.0.0-RC23063.183025.163088.511495.832201.622581.02
artemis-odb-2.0.0-RC2_fast3770.173280.943280.771543.032349.882817.17
ashley-1.6.02357.24747.36157.02
gdx-artemis-0.5.02518.072257.00375.60
retinazer-0.2.04989.422779.121832.265237.94

Benchmarks: 65536 entites

it64k ir64k arc64k

ECSbaselineplainpooledinsert/removeedittransmute
artemis-odb-0.4.0321.93231.2423.06
artemis-odb-0.9.0643.59715.33641.3994.49257.62342.33
artemis-odb-0.9.0_fast837.87778.02779.9193.59266.31353.99
artemis-odb-1.0.1777.32721.85722.7696.40433.83587.22
artemis-odb-1.0.1_fast940.23804.48803.4995.85440.08630.28
artemis-odb-2.0.0-RC1754.81761.89764.03324.07531.41623.48
artemis-odb-2.0.0-RC1_fast942.25798.78818.32334.10570.92688.43
artemis-odb-2.0.0-RC2755.53743.70747.61325.39546.60642.08
artemis-odb-2.0.0-RC2_fast941.18815.75818.53336.52582.39694.83
ashley-1.6.0272.7274.1212.58
gdx-artemis-0.5.0341.71374.1767.38
retinazer-0.2.01136.29670.11279.421262.34

Benchmarks: 262144 entites

it256k ir256k arc256k

ECSbaselineplainpooledinsert/removeedittransmute
artemis-odb-0.4.071.6255.362.24
artemis-odb-0.9.0160.87132.16132.8212.8232.4054.80
artemis-odb-0.9.0_fast209.12159.65153.9713.0331.9155.51
artemis-odb-1.0.1175.67137.73136.0214.4888.26135.43
artemis-odb-1.0.1_fast235.38156.37156.0614.5691.62148.32
artemis-odb-2.0.0-RC1175.42137.92137.7758.08123.32153.13
artemis-odb-2.0.0-RC1_fast235.92145.90145.4362.89124.02159.13
artemis-odb-2.0.0-RC2177.21138.00136.7163.9998.55151.73
artemis-odb-2.0.0-RC2_fast232.51147.59146.8862.76134.52163.33
ashley-1.6.047.4515.780.85
gdx-artemis-0.5.096.6975.7112.85
retinazer-0.2.0311.30159.4326.61282.48