Skip to content

Instantly share code, notes, and snippets.

@SanderMertens
Created April 26, 2020 09:09
Show Gist options
  • Save SanderMertens/81cf150f94c638b5f335f2e7ec2ae2aa to your computer and use it in GitHub Desktop.
Save SanderMertens/81cf150f94c638b5f335f2e7ec2ae2aa to your computer and use it in GitHub Desktop.

Creating entities


Entity creation, empty (n = 1000000):

Framework Measurement
EnTT 0.003885
EnTT 0.002851 (batching)
Flecs 0.002183
Flecs 0.000002 (batching)

Entity creation, 1 component (n = 1000000):

Framework Measurement
EnTT 0.020763
EnTT 0.016105 (prealloc)
EnTT 0.019004 (batching)
EnTT 0.016014 (batching, prealloc)
Flecs 0.054010
Flecs 0.041535 (prealloc)
Flecs 0.015325 (batching)
Flecs 0.008733 (batching, prealloc)

Entity creation, 2 component (n = 1000000):

Framework Measurement
EnTT 0.040723
EnTT 0.072564 (group)
EnTT 0.029323 (prealloc)
EnTT 0.037582 (batching)
EnTT 0.028950 (batching, prealloc)
EnTT 0.061740 (group, batch, prealloc)
Flecs 0.059002
Flecs 0.045178 (prealloc)
Flecs 0.016150 (batching)
Flecs 0.008996 (batching, prealloc)

Entity creation, 3 component (n = 1000000):

Framework Measurement
EnTT 0.060736
EnTT 0.116404 (group)
EnTT 0.056754 (batching)
EnTT 0.046042 (prealloc)
EnTT 0.043656 (batching, prealloc)
EnTT 0.097455 (group, batch, prealloc)
Flecs 0.067269
Flecs 0.051793 (prealloc)
Flecs 0.016733 (batching)
Flecs 0.008611 (batching, prealloc)

Entity deletion, 1 component (n = 1000000):

Framework Measurement
EnTT 0.010586
Flecs 0.039347

Adding & removing components


Add one component (n = 1000000):

Framework Measurement
EnTT 0.011405
Flecs 0.045979
Flecs 0.041949 (new w/component)
Flecs 0.062620 (to existing)
Flecs 0.004899 (to existing, bulk)

Add two components (n = 1000000):

Framework Measurement
EnTT 0.026182
EnTT 0.049856 (group)
Flecs 0.104675
Flecs 0.050565 (w/type)
Flecs 0.004963 (to existing, bulk)

Add three components (n = 1000000):

Framework Measurement
EnTT 0.038701
EnTT 0.081539 (group)
Flecs 0.182875
Flecs 0.057925 (w/type)
Flecs 0.005445 (to existing, bulk)

Add four components (n = 1000000):

Framework Measurement
EnTT 0.050804
EnTT 0.123943 (group)
Flecs 0.281679
Flecs 0.083186 (w/type)

Remove one component (n = 1000000):

Framework Measurement
EnTT 0.006571
EnTT 0.006435 (2 components)
EnTT 0.031558 (2 components, group)
Flecs 0.043705
Flecs 0.076521 (2 components)
Flecs 0.008093 (2 components, bulk)

Remove two components (n = 1000000):

Framework Measurement
EnTT 0.015961
EnTT 0.044271 (group)
Flecs 0.099121
Flecs 0.045020 (w/type)

Remove three components (n = 1000000):

Framework Measurement
EnTT 0.027496
EnTT 0.063556 (group)
Flecs 0.174181
Flecs 0.052527 (w/type)

Remove four components (n = 1000000):

Framework Measurement
EnTT 0.043570
EnTT 0.094226 (group)
Flecs 0.251029
Flecs 0.056783 (w/type)

Iterating over entities with systems


Iterate, one component (n = 1000000):

Framework Measurement
EnTT 0.000302 (view)
Flecs 0.000312

Iterate, two components (n = 1000000):

Framework Measurement
EnTT 0.001328 (view)
EnTT 0.000451 (group, owning)
Flecs 0.000501

Iterate, two components, eight types (n = 1000000):

Framework Measurement
EnTT 0.001341 (view)
EnTT 0.000450 (group, owning)
Flecs 0.000421

Iterate, two components, eight types, four matching (n = 1000000):

Framework Measurement
EnTT 0.002415 (view)
EnTT 0.000414 (group, owning)
Flecs 0.000432

Iterate, three components (n = 1000000):

Framework Measurement
EnTT 0.002078 (view)
EnTT 0.000683 (group, owning)
Flecs 0.000624

Iterate, three components, two types (n = 1000000):

Framework Measurement
EnTT 0.001672 (view)
EnTT 0.000686 (group, owning)
Flecs 0.005800

Iterate, three components, eight types (n = 1000000):

Framework Measurement
EnTT 0.001957 (view)
EnTT 0.000676 (group, owning)
Flecs 0.010478

Iterate, three components, eight types, four matching (n = 1000000):

Framework Measurement
EnTT 0.003991 (view)
EnTT 0.000744 (group, owning)
Flecs 0.010096

Iterate, four components, eight types (n = 1000000):

Framework Measurement
EnTT 0.001982 (view)
EnTT 0.000869 (group, owning)
Flecs 0.018458

Iterate, four components, eight types, four matching (n = 1000000):

Framework Measurement
EnTT 0.003833 (view)
EnTT 0.000865 (group, owning)
Flecs 0.017845

Ten randomized components


Pathological, one component, 1024 types (n = 1000000):

Framework Measurement
EnTT 0.000300 (view)
Flecs 0.000335

Pathological, two components, 1024 types (n = 1000000):

Framework Measurement
EnTT 0.001322 (view)
EnTT 0.000423 (group, owning)
Flecs 0.000576

Pathological, three components, 1024 types (n = 1000000):

Framework Measurement
EnTT 0.001964 (view)
EnTT 0.000681 (group, owning)
Flecs 0.000910

Pathological, four components, 1024 types (n = 1000000):

Framework Measurement
EnTT 0.003135 (view)
EnTT 0.000859 (group, owning)
Flecs 0.001155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment