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

[Merged by Bors] - Extend EntityLocation with TableId and TableRow #6681

Closed
wants to merge 20 commits into from

Conversation

james7132
Copy link
Member

@james7132 james7132 commented Nov 18, 2022

Objective

Query::get and other random access methods require looking up EntityLocation for every provided entity, then always looking up the Archetype to get the table ID and table row. This requires 4 total random fetches from memory: the Entities lookup, the Archetype lookup, the table row lookup, and the final fetch from table/sparse sets. If EntityLocation contains the table ID and table row, only the Entities lookup and the final storage fetch are required.

Solution

Add TableId and table row to EntityLocation. Ensure it's updated whenever entities are moved around. To ensure EntityMeta does not grow bigger, both TableId and ArchetypeId have been shrunk to u32, and the archetype index and table row are stored as u32s instead of as usizes. This should shrink EntityMeta by 4 bytes, from 24 to 20 bytes, as there is no padding anymore due to the change in alignment.

This idea was partially concocted by @BoxyUwU.

Performance

This should restore the Query::get "gains" lost to #6625 that were introduced in #4800 without being unsound, and also incorporates some of the memory usage reductions seen in #3678.

This also removes the same lookups during add/remove/spawn commands, so there may be a bit of a speedup in commands and Entity{Ref,Mut}.


Changelog

Added: EntityLocation::table_id
Added: EntityLocation::table_row.
Changed: Worlds can now only hold a maximum of 232- 1 archetypes.
Changed: Worlds can now only hold a maximum of 232 - 1 tables.

Migration Guide

A World can only hold a maximum of 232 - 1 archetypes and tables now. If your use case requires more than this, please file an issue explaining your use case.

@james7132 james7132 added A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times labels Nov 18, 2022
@alice-i-cecile alice-i-cecile added the S-Needs-Benchmarking This set of changes needs performance benchmarking to double-check that they help label Nov 18, 2022
@BoxyUwU BoxyUwU self-requested a review November 18, 2022 12:13
@targrub
Copy link
Contributor

targrub commented Nov 18, 2022

This sounds like it should be a clear performance win (though benchmarks will tell). Congratulations!

@james7132
Copy link
Member Author

Here's a set of the relevant benchmarks. As expected, Query::get and all of the other APIs that use get_unchecked_manual saw a sizable perf increase. A bunch of other iteration ones also consistently improved as well, not sure if this is due to the reduction in ID size or just noise, but I reran the benchmarks several times and it seems consistent. Adding/removing components seems to have been unimpacted by this change, strangely enough.

group                                                             flatten-entity-location                 main
-----                                                             -----------------------                 ----
add_remove/sparse_set                                             1.01  1051.9±73.39µs        ? ?/sec     1.00  1041.8±116.24µs        ? ?/sec
add_remove/table                                                  1.03  1304.9±25.03µs        ? ?/sec     1.00  1272.2±51.07µs        ? ?/sec
add_remove_big/sparse_set                                         1.02  1179.0±320.13µs        ? ?/sec    1.00  1161.0±279.54µs        ? ?/sec
add_remove_big/table                                              1.00      2.3±0.07ms        ? ?/sec     1.00      2.3±0.13ms        ? ?/sec
added_archetypes/archetype_count/100                              1.00    131.9±6.74µs        ? ?/sec     1.33   175.0±10.49µs        ? ?/sec
added_archetypes/archetype_count/1000                             1.34   700.4±53.76µs        ? ?/sec     1.00   522.2±13.13µs        ? ?/sec
added_archetypes/archetype_count/10000                            1.06      6.7±0.67ms        ? ?/sec     1.00      6.3±0.45ms        ? ?/sec
added_archetypes/archetype_count/200                              1.00    185.8±7.05µs        ? ?/sec     1.17   217.2±15.28µs        ? ?/sec
added_archetypes/archetype_count/2000                             1.18  1159.2±155.38µs        ? ?/sec    1.00   981.8±18.35µs        ? ?/sec
added_archetypes/archetype_count/500                              1.18   369.8±15.64µs        ? ?/sec     1.00   312.3±20.71µs        ? ?/sec
added_archetypes/archetype_count/5000                             1.08      2.8±0.24ms        ? ?/sec     1.00      2.6±0.15ms        ? ?/sec
build_schedule/1000_schedule                                      1.00   319.4±11.83ms        ? ?/sec     1.05    336.2±8.19ms        ? ?/sec
build_schedule/1000_schedule_noconstraints                        1.00      2.0±0.06ms        ? ?/sec     1.07      2.2±0.05ms        ? ?/sec
build_schedule/100_schedule                                       1.07      2.0±0.01ms        ? ?/sec     1.00  1913.3±21.38µs        ? ?/sec
build_schedule/100_schedule_noconstraints                         1.00    166.4±5.74µs        ? ?/sec     1.22   203.1±10.66µs        ? ?/sec
build_schedule/500_schedule                                       1.00     58.9±1.59ms        ? ?/sec     1.07     62.7±4.07ms        ? ?/sec
build_schedule/500_schedule_noconstraints                         1.00  1072.2±30.84µs        ? ?/sec     1.04  1117.5±16.95µs        ? ?/sec
busy_systems/01x_entities_03_systems                              1.00     33.7±1.30µs        ? ?/sec     1.20     40.5±1.13µs        ? ?/sec
busy_systems/01x_entities_06_systems                              1.00     61.8±2.33µs        ? ?/sec     1.23     76.0±2.99µs        ? ?/sec
busy_systems/01x_entities_09_systems                              1.00     92.9±4.67µs        ? ?/sec     1.27    118.0±3.89µs        ? ?/sec
busy_systems/01x_entities_12_systems                              1.00    122.0±2.68µs        ? ?/sec     1.26    153.4±4.65µs        ? ?/sec
busy_systems/01x_entities_15_systems                              1.00    152.6±4.47µs        ? ?/sec     1.21    185.2±3.32µs        ? ?/sec
busy_systems/02x_entities_03_systems                              1.00     67.1±3.83µs        ? ?/sec     1.12     74.9±2.89µs        ? ?/sec
busy_systems/02x_entities_06_systems                              1.00    112.5±3.47µs        ? ?/sec     1.22    137.6±5.77µs        ? ?/sec
busy_systems/02x_entities_09_systems                              1.00    180.6±6.99µs        ? ?/sec     1.19    214.8±8.53µs        ? ?/sec
busy_systems/02x_entities_12_systems                              1.00    228.0±9.13µs        ? ?/sec     1.11    253.0±8.88µs        ? ?/sec
busy_systems/02x_entities_15_systems                              1.00    272.7±6.75µs        ? ?/sec     1.17    318.9±8.95µs        ? ?/sec
busy_systems/03x_entities_03_systems                              1.00     96.5±5.69µs        ? ?/sec     1.00     96.3±6.11µs        ? ?/sec
busy_systems/03x_entities_06_systems                              1.00   166.9±10.56µs        ? ?/sec     1.42   236.7±10.27µs        ? ?/sec
busy_systems/03x_entities_09_systems                              1.00   243.6±10.63µs        ? ?/sec     1.31   318.9±11.39µs        ? ?/sec
busy_systems/03x_entities_12_systems                              1.00   333.3±11.39µs        ? ?/sec     1.15   382.7±13.18µs        ? ?/sec
busy_systems/03x_entities_15_systems                              1.00   409.1±18.38µs        ? ?/sec     1.21   493.3±14.70µs        ? ?/sec
busy_systems/04x_entities_03_systems                              1.00    134.7±7.95µs        ? ?/sec     1.11    149.6±5.15µs        ? ?/sec
busy_systems/04x_entities_06_systems                              1.00   227.2±13.92µs        ? ?/sec     1.36   307.9±15.00µs        ? ?/sec
busy_systems/04x_entities_09_systems                              1.00   328.9±19.83µs        ? ?/sec     1.32   435.7±21.85µs        ? ?/sec
busy_systems/04x_entities_12_systems                              1.00   418.2±11.57µs        ? ?/sec     1.13   470.9±13.96µs        ? ?/sec
busy_systems/04x_entities_15_systems                              1.00   542.3±21.57µs        ? ?/sec     1.17   633.7±18.47µs        ? ?/sec
busy_systems/05x_entities_03_systems                              1.05    159.8±9.68µs        ? ?/sec     1.00   152.4±13.60µs        ? ?/sec
busy_systems/05x_entities_06_systems                              1.00   291.8±17.32µs        ? ?/sec     1.14   333.6±16.74µs        ? ?/sec
busy_systems/05x_entities_09_systems                              1.00   419.7±17.29µs        ? ?/sec     1.18   497.1±22.90µs        ? ?/sec
busy_systems/05x_entities_12_systems                              1.00   552.1±33.58µs        ? ?/sec     1.07   589.8±19.04µs        ? ?/sec
busy_systems/05x_entities_15_systems                              1.00   681.4±30.55µs        ? ?/sec     1.26   858.3±22.68µs        ? ?/sec
contrived/01x_entities_03_systems                                 1.00     24.5±2.55µs        ? ?/sec     1.11     27.1±0.76µs        ? ?/sec
contrived/01x_entities_06_systems                                 1.00     42.1±3.41µs        ? ?/sec     1.15     48.5±0.93µs        ? ?/sec
contrived/01x_entities_09_systems                                 1.00     59.9±3.80µs        ? ?/sec     1.22     72.9±1.48µs        ? ?/sec
contrived/01x_entities_12_systems                                 1.00     84.3±6.67µs        ? ?/sec     1.13     95.1±1.87µs        ? ?/sec
contrived/01x_entities_15_systems                                 1.00    98.9±11.40µs        ? ?/sec     1.18    116.6±1.06µs        ? ?/sec
contrived/02x_entities_03_systems                                 1.00     34.4±3.03µs        ? ?/sec     1.21     41.6±0.58µs        ? ?/sec
contrived/02x_entities_06_systems                                 1.00     62.5±4.85µs        ? ?/sec     1.32     82.5±1.35µs        ? ?/sec
contrived/02x_entities_09_systems                                 1.00     98.8±5.72µs        ? ?/sec     1.19    117.4±3.33µs        ? ?/sec
contrived/02x_entities_12_systems                                 1.00   127.7±12.34µs        ? ?/sec     1.17    148.9±5.01µs        ? ?/sec
contrived/02x_entities_15_systems                                 1.00   156.6±10.00µs        ? ?/sec     1.18    184.7±3.99µs        ? ?/sec
contrived/03x_entities_03_systems                                 1.00     44.9±4.11µs        ? ?/sec     1.24     55.5±1.05µs        ? ?/sec
contrived/03x_entities_06_systems                                 1.00     88.5±8.03µs        ? ?/sec     1.26    111.7±2.27µs        ? ?/sec
contrived/03x_entities_09_systems                                 1.00    132.5±5.98µs        ? ?/sec     1.16    154.3±2.40µs        ? ?/sec
contrived/03x_entities_12_systems                                 1.00    170.3±9.82µs        ? ?/sec     1.21    206.5±4.31µs        ? ?/sec
contrived/03x_entities_15_systems                                 1.00   220.4±13.94µs        ? ?/sec     1.12    246.1±5.08µs        ? ?/sec
contrived/04x_entities_03_systems                                 1.00     62.7±6.72µs        ? ?/sec     1.14     71.2±2.31µs        ? ?/sec
contrived/04x_entities_06_systems                                 1.00    103.9±5.78µs        ? ?/sec     1.36    141.4±3.22µs        ? ?/sec
contrived/04x_entities_09_systems                                 1.00    156.4±7.85µs        ? ?/sec     1.26    196.7±3.06µs        ? ?/sec
contrived/04x_entities_12_systems                                 1.00    208.0±7.14µs        ? ?/sec     1.21    252.4±6.97µs        ? ?/sec
contrived/04x_entities_15_systems                                 1.00   285.2±14.53µs        ? ?/sec     1.07    304.6±8.18µs        ? ?/sec
contrived/05x_entities_03_systems                                 1.00     76.9±5.02µs        ? ?/sec     1.07     82.2±3.16µs        ? ?/sec
contrived/05x_entities_06_systems                                 1.00   161.7±13.49µs        ? ?/sec     1.00    162.0±5.58µs        ? ?/sec
contrived/05x_entities_09_systems                                 1.00   212.2±10.26µs        ? ?/sec     1.00    211.5±4.81µs        ? ?/sec
contrived/05x_entities_12_systems                                 1.00    260.1±8.34µs        ? ?/sec     1.12    291.8±6.24µs        ? ?/sec
contrived/05x_entities_15_systems                                 1.17   391.8±24.42µs        ? ?/sec     1.00    335.5±6.68µs        ? ?/sec
empty_commands/0_entities                                         1.01      5.2±0.17ns        ? ?/sec     1.00      5.2±0.03ns        ? ?/sec
empty_systems/000_systems                                         1.09     63.7±0.14ns        ? ?/sec     1.00     58.2±0.25ns        ? ?/sec
empty_systems/001_systems                                         1.19      4.6±0.15µs        ? ?/sec     1.00      3.9±0.18µs        ? ?/sec
empty_systems/002_systems                                         1.09      5.7±0.46µs        ? ?/sec     1.00      5.2±0.13µs        ? ?/sec
empty_systems/003_systems                                         1.04      6.9±0.15µs        ? ?/sec     1.00      6.6±0.09µs        ? ?/sec
empty_systems/004_systems                                         1.08      8.1±0.14µs        ? ?/sec     1.00      7.5±0.18µs        ? ?/sec
empty_systems/005_systems                                         1.13      9.0±0.45µs        ? ?/sec     1.00      8.0±0.13µs        ? ?/sec
empty_systems/010_systems                                         1.13     14.3±1.03µs        ? ?/sec     1.00     12.6±0.42µs        ? ?/sec
empty_systems/015_systems                                         1.04     18.1±1.52µs        ? ?/sec     1.00     17.4±0.69µs        ? ?/sec
empty_systems/020_systems                                         1.00     21.6±1.37µs        ? ?/sec     1.01     21.8±0.72µs        ? ?/sec
empty_systems/025_systems                                         1.00     25.7±1.37µs        ? ?/sec     1.03     26.5±1.07µs        ? ?/sec
empty_systems/030_systems                                         1.00     30.5±1.66µs        ? ?/sec     1.04     31.9±1.09µs        ? ?/sec
empty_systems/035_systems                                         1.00     33.5±1.20µs        ? ?/sec     1.10     36.9±1.25µs        ? ?/sec
empty_systems/040_systems                                         1.00     36.9±1.91µs        ? ?/sec     1.12     41.4±1.39µs        ? ?/sec
empty_systems/045_systems                                         1.00     39.4±1.99µs        ? ?/sec     1.16     45.8±1.59µs        ? ?/sec
empty_systems/050_systems                                         1.00     43.9±2.02µs        ? ?/sec     1.17     51.4±1.62µs        ? ?/sec
empty_systems/055_systems                                         1.00     49.4±1.88µs        ? ?/sec     1.12     55.5±2.07µs        ? ?/sec
empty_systems/060_systems                                         1.00     53.4±2.50µs        ? ?/sec     1.15     61.4±2.97µs        ? ?/sec
empty_systems/065_systems                                         1.00     58.1±3.41µs        ? ?/sec     1.13     65.7±3.35µs        ? ?/sec
empty_systems/070_systems                                         1.00     62.6±2.93µs        ? ?/sec     1.14     71.5±2.77µs        ? ?/sec
empty_systems/075_systems                                         1.00     67.6±2.51µs        ? ?/sec     1.13     76.3±2.68µs        ? ?/sec
empty_systems/080_systems                                         1.00     68.5±3.20µs        ? ?/sec     1.19     81.7±2.93µs        ? ?/sec
empty_systems/085_systems                                         1.00     75.1±2.66µs        ? ?/sec     1.17     87.8±3.22µs        ? ?/sec
empty_systems/090_systems                                         1.00     82.2±3.48µs        ? ?/sec     1.11     91.6±3.48µs        ? ?/sec
empty_systems/095_systems                                         1.00     85.8±3.98µs        ? ?/sec     1.14     97.4±4.45µs        ? ?/sec
empty_systems/100_systems                                         1.00     93.9±4.10µs        ? ?/sec     1.11    104.5±3.97µs        ? ?/sec
fake_commands/2000_commands                                       1.00      7.2±0.15µs        ? ?/sec     1.00      7.2±0.02µs        ? ?/sec
fake_commands/4000_commands                                       1.00     14.4±0.30µs        ? ?/sec     1.00     14.5±0.06µs        ? ?/sec
fake_commands/6000_commands                                       1.00     21.5±0.28µs        ? ?/sec     1.00     21.6±0.07µs        ? ?/sec
fake_commands/8000_commands                                       1.00     28.7±0.11µs        ? ?/sec     1.01     28.9±0.17µs        ? ?/sec
get_or_spawn/batched                                              1.08   441.1±41.81µs        ? ?/sec     1.00   408.3±12.78µs        ? ?/sec
get_or_spawn/individual                                           1.00   722.0±35.25µs        ? ?/sec     1.02   734.2±32.90µs        ? ?/sec
heavy_compute/base                                                1.00    291.8±2.24µs        ? ?/sec     1.02    298.4±4.10µs        ? ?/sec
insert_commands/insert                                            1.00   630.1±42.11µs        ? ?/sec     1.00   630.1±27.92µs        ? ?/sec
insert_commands/insert_batch                                      1.07   437.8±21.34µs        ? ?/sec     1.00   408.9±21.70µs        ? ?/sec
insert_simple/base                                                1.04    386.0±1.94µs        ? ?/sec     1.00    370.0±5.64µs        ? ?/sec
insert_simple/unbatched                                           1.01   908.2±24.22µs        ? ?/sec     1.00   899.0±40.24µs        ? ?/sec
iter_fragmented/base                                              1.00    345.5±5.01ns        ? ?/sec     1.00    346.8±5.98ns        ? ?/sec
iter_fragmented/foreach                                           1.00   223.8±22.00ns        ? ?/sec     1.04   232.9±21.78ns        ? ?/sec
iter_fragmented/foreach_wide                                      1.00      3.9±0.15µs        ? ?/sec     1.02      4.0±0.14µs        ? ?/sec
iter_fragmented/wide                                              1.01      4.0±0.19µs        ? ?/sec     1.00      4.0±0.14µs        ? ?/sec
iter_fragmented_sparse/base                                       1.00      7.8±0.24ns        ? ?/sec     1.01      7.8±0.26ns        ? ?/sec
iter_fragmented_sparse/foreach                                    1.00      7.6±0.27ns        ? ?/sec     1.00      7.7±0.46ns        ? ?/sec
iter_fragmented_sparse/foreach_wide                               1.05     40.2±9.13ns        ? ?/sec     1.00     38.5±1.08ns        ? ?/sec
iter_fragmented_sparse/wide                                       1.02     43.1±1.04ns        ? ?/sec     1.00     42.1±1.40ns        ? ?/sec
iter_simple/base                                                  1.00      8.4±0.08µs        ? ?/sec     1.01      8.4±0.40µs        ? ?/sec
iter_simple/foreach                                               1.01      8.5±0.07µs        ? ?/sec     1.00      8.5±0.05µs        ? ?/sec
iter_simple/foreach_sparse_set                                    1.00     25.9±0.20µs        ? ?/sec     1.01     26.0±0.19µs        ? ?/sec
iter_simple/foreach_wide                                          1.05     39.5±0.81µs        ? ?/sec     1.00     37.7±0.57µs        ? ?/sec
iter_simple/foreach_wide_sparse_set                               1.00    116.0±2.79µs        ? ?/sec     1.00    116.2±1.19µs        ? ?/sec
iter_simple/sparse_set                                            1.07     28.4±0.21µs        ? ?/sec     1.00     26.5±0.58µs        ? ?/sec
iter_simple/system                                                1.01      8.3±0.04µs        ? ?/sec     1.00      8.1±0.06µs        ? ?/sec
iter_simple/wide                                                  1.00     40.6±1.02µs        ? ?/sec     1.03     42.0±0.44µs        ? ?/sec
iter_simple/wide_sparse_set                                       1.00    125.0±1.09µs        ? ?/sec     1.03    128.2±1.18µs        ? ?/sec
no_archetypes/system_count/0                                      1.08     63.3±0.22ns        ? ?/sec     1.00     58.7±0.58ns        ? ?/sec
no_archetypes/system_count/100                                    1.00     86.7±4.01µs        ? ?/sec     1.17    101.2±4.08µs        ? ?/sec
no_archetypes/system_count/20                                     1.00     20.9±1.38µs        ? ?/sec     1.03     21.6±0.70µs        ? ?/sec
no_archetypes/system_count/40                                     1.00     35.3±1.62µs        ? ?/sec     1.15     40.6±1.30µs        ? ?/sec
no_archetypes/system_count/60                                     1.00     51.3±2.46µs        ? ?/sec     1.16     59.7±1.56µs        ? ?/sec
no_archetypes/system_count/80                                     1.00     67.4±2.48µs        ? ?/sec     1.17     78.8±2.68µs        ? ?/sec
query_get/50000_entities_sparse                                   1.00   319.8±15.32µs        ? ?/sec     1.16    371.6±3.88µs        ? ?/sec
query_get/50000_entities_table                                    1.00    279.4±0.70µs        ? ?/sec     1.70    474.2±3.44µs        ? ?/sec
query_get_component/50000_entities_sparse                         1.00    981.3±6.10µs        ? ?/sec     1.01   994.2±26.06µs        ? ?/sec
query_get_component/50000_entities_table                          1.00    904.0±2.25µs        ? ?/sec     1.15  1043.1±13.16µs        ? ?/sec
query_get_component_simple/system                                 1.00    558.4±6.35µs        ? ?/sec     1.24    693.9±7.87µs        ? ?/sec
query_get_component_simple/unchecked                              1.00   748.8±11.54µs        ? ?/sec     1.05    789.3±6.15µs        ? ?/sec
query_get_many_10/50000_calls_sparse                              1.00      4.2±0.30ms        ? ?/sec     1.16      4.9±0.47ms        ? ?/sec
query_get_many_10/50000_calls_table                               1.00      3.9±0.13ms        ? ?/sec     1.60      6.2±0.50ms        ? ?/sec
query_get_many_2/50000_calls_sparse                               1.00   652.5±34.28µs        ? ?/sec     1.22   795.7±49.72µs        ? ?/sec
query_get_many_2/50000_calls_table                                1.00   660.7±31.49µs        ? ?/sec     1.61  1061.5±193.51µs        ? ?/sec
query_get_many_5/50000_calls_sparse                               1.00  1949.5±100.58µs        ? ?/sec    1.17      2.3±0.17ms        ? ?/sec
query_get_many_5/50000_calls_table                                1.00  1778.2±80.03µs        ? ?/sec     1.56      2.8±0.34ms        ? ?/sec
run_criteria/no/001_systems                                       1.02     79.2±1.20ns        ? ?/sec     1.00     77.9±0.42ns        ? ?/sec
run_criteria/no/006_systems                                       1.00    159.8±1.13ns        ? ?/sec     1.03   164.0±19.05ns        ? ?/sec
run_criteria/no/011_systems                                       1.03    233.1±1.10ns        ? ?/sec     1.00    226.5±6.19ns        ? ?/sec
run_criteria/no/016_systems                                       1.06    320.0±2.38ns        ? ?/sec     1.00    303.1±2.34ns        ? ?/sec
run_criteria/no/021_systems                                       1.02    391.8±3.51ns        ? ?/sec     1.00    385.2±1.75ns        ? ?/sec
run_criteria/no/026_systems                                       1.00    473.5±5.96ns        ? ?/sec     1.00    471.6±1.58ns        ? ?/sec
run_criteria/no/031_systems                                       1.02    557.7±5.68ns        ? ?/sec     1.00    547.7±9.03ns        ? ?/sec
run_criteria/no/036_systems                                       1.01    656.4±6.37ns        ? ?/sec     1.00    652.7±4.16ns        ? ?/sec
run_criteria/no/041_systems                                       1.05    779.6±5.14ns        ? ?/sec     1.00    741.6±4.35ns        ? ?/sec
run_criteria/no/046_systems                                       1.00    867.7±4.13ns        ? ?/sec     1.01    876.9±8.92ns        ? ?/sec
run_criteria/no/051_systems                                       1.01   991.2±10.88ns        ? ?/sec     1.00    976.9±8.08ns        ? ?/sec
run_criteria/no/056_systems                                       1.02   1085.9±4.81ns        ? ?/sec     1.00  1062.6±11.15ns        ? ?/sec
run_criteria/no/061_systems                                       1.02  1178.0±11.19ns        ? ?/sec     1.00  1154.0±14.08ns        ? ?/sec
run_criteria/no/066_systems                                       1.00   1247.9±5.78ns        ? ?/sec     1.01   1265.8±7.17ns        ? ?/sec
run_criteria/no/071_systems                                       1.00   1353.5±5.95ns        ? ?/sec     1.00  1350.4±39.87ns        ? ?/sec
run_criteria/no/076_systems                                       1.00  1439.0±17.66ns        ? ?/sec     1.01   1454.3±6.16ns        ? ?/sec
run_criteria/no/081_systems                                       1.00   1530.8±7.42ns        ? ?/sec     1.01  1552.1±14.90ns        ? ?/sec
run_criteria/no/086_systems                                       1.01   1628.5±9.90ns        ? ?/sec     1.00  1609.6±10.29ns        ? ?/sec
run_criteria/no/091_systems                                       1.01  1724.9±24.76ns        ? ?/sec     1.00  1707.8±10.39ns        ? ?/sec
run_criteria/no/096_systems                                       1.02  1817.4±19.77ns        ? ?/sec     1.00   1788.2±6.47ns        ? ?/sec
run_criteria/no/101_systems                                       1.02   1917.1±9.25ns        ? ?/sec     1.00  1879.0±19.86ns        ? ?/sec
run_criteria/no_with_labels/001_systems                           1.05     81.8±2.89ns        ? ?/sec     1.00     78.1±0.31ns        ? ?/sec
run_criteria/no_with_labels/006_systems                           1.02    133.8±3.56ns        ? ?/sec     1.00    131.4±1.29ns        ? ?/sec
run_criteria/no_with_labels/011_systems                           1.01    194.3±1.05ns        ? ?/sec     1.00    191.6±3.36ns        ? ?/sec
run_criteria/no_with_labels/016_systems                           1.02    250.6±1.33ns        ? ?/sec     1.00    245.8±4.22ns        ? ?/sec
run_criteria/no_with_labels/021_systems                           1.02    312.5±3.31ns        ? ?/sec     1.00    307.3±2.07ns        ? ?/sec
run_criteria/no_with_labels/026_systems                           1.00    367.6±1.74ns        ? ?/sec     1.00    368.9±2.58ns        ? ?/sec
run_criteria/no_with_labels/031_systems                           1.01    438.6±5.83ns        ? ?/sec     1.00    432.5±4.83ns        ? ?/sec
run_criteria/no_with_labels/036_systems                           1.01    501.3±2.75ns        ? ?/sec     1.00    497.4±4.20ns        ? ?/sec
run_criteria/no_with_labels/041_systems                           1.02    567.6±6.36ns        ? ?/sec     1.00    555.9±3.03ns        ? ?/sec
run_criteria/no_with_labels/046_systems                           1.01    617.5±3.60ns        ? ?/sec     1.00    612.8±4.39ns        ? ?/sec
run_criteria/no_with_labels/051_systems                           1.00    679.4±5.83ns        ? ?/sec     1.00    678.1±3.99ns        ? ?/sec
run_criteria/no_with_labels/056_systems                           1.12  818.7±166.16ns        ? ?/sec     1.00    731.8±5.42ns        ? ?/sec
run_criteria/no_with_labels/061_systems                           1.00    791.2±5.55ns        ? ?/sec     1.02    807.9±9.03ns        ? ?/sec
run_criteria/no_with_labels/066_systems                           1.00   876.1±14.46ns        ? ?/sec     1.03    899.4±2.78ns        ? ?/sec
run_criteria/no_with_labels/071_systems                           1.00   960.5±73.13ns        ? ?/sec     1.00    959.6±5.16ns        ? ?/sec
run_criteria/no_with_labels/076_systems                           1.00    993.2±8.60ns        ? ?/sec     1.02   1011.4±6.65ns        ? ?/sec
run_criteria/no_with_labels/081_systems                           1.00  1059.5±10.90ns        ? ?/sec     1.02   1080.3±4.57ns        ? ?/sec
run_criteria/no_with_labels/086_systems                           1.00   1122.7±5.21ns        ? ?/sec     1.00   1123.1±6.60ns        ? ?/sec
run_criteria/no_with_labels/091_systems                           1.02   1207.0±9.79ns        ? ?/sec     1.00   1188.3±8.79ns        ? ?/sec
run_criteria/no_with_labels/096_systems                           1.00   1264.6±9.43ns        ? ?/sec     1.13   1433.2±9.20ns        ? ?/sec
run_criteria/no_with_labels/101_systems                           1.00   1321.6±3.09ns        ? ?/sec     1.00  1317.1±17.82ns        ? ?/sec
run_criteria/yes/001_systems                                      1.36      4.9±0.09µs        ? ?/sec     1.00      3.6±0.31µs        ? ?/sec
run_criteria/yes/006_systems                                      1.17      9.9±0.65µs        ? ?/sec     1.00      8.4±0.21µs        ? ?/sec
run_criteria/yes/011_systems                                      1.15     15.1±1.12µs        ? ?/sec     1.00     13.1±0.41µs        ? ?/sec
run_criteria/yes/016_systems                                      1.05     18.8±1.58µs        ? ?/sec     1.00     17.8±0.82µs        ? ?/sec
run_criteria/yes/021_systems                                      1.00     22.1±1.78µs        ? ?/sec     1.02     22.5±0.88µs        ? ?/sec
run_criteria/yes/026_systems                                      1.00     26.0±1.56µs        ? ?/sec     1.08     28.2±1.03µs        ? ?/sec
run_criteria/yes/031_systems                                      1.00     29.8±2.27µs        ? ?/sec     1.09     32.5±1.07µs        ? ?/sec
run_criteria/yes/036_systems                                      1.00     32.7±2.33µs        ? ?/sec     1.15     37.6±0.92µs        ? ?/sec
run_criteria/yes/041_systems                                      1.00     35.8±2.22µs        ? ?/sec     1.18     42.1±1.17µs        ? ?/sec
run_criteria/yes/046_systems                                      1.00     41.1±2.60µs        ? ?/sec     1.13     46.3±1.19µs        ? ?/sec
run_criteria/yes/051_systems                                      1.00     43.7±2.51µs        ? ?/sec     1.17     51.1±1.27µs        ? ?/sec
run_criteria/yes/056_systems                                      1.00     46.9±2.00µs        ? ?/sec     1.19     55.7±2.05µs        ? ?/sec
run_criteria/yes/061_systems                                      1.00     52.9±1.81µs        ? ?/sec     1.16     61.3±2.93µs        ? ?/sec
run_criteria/yes/066_systems                                      1.00     54.7±4.16µs        ? ?/sec     1.21     66.2±2.82µs        ? ?/sec
run_criteria/yes/071_systems                                      1.00     60.7±4.91µs        ? ?/sec     1.16     70.6±3.05µs        ? ?/sec
run_criteria/yes/076_systems                                      1.00     63.1±3.81µs        ? ?/sec     1.19     75.0±4.10µs        ? ?/sec
run_criteria/yes/081_systems                                      1.00     67.3±5.39µs        ? ?/sec     1.18     79.3±3.69µs        ? ?/sec
run_criteria/yes/086_systems                                      1.00     72.8±3.22µs        ? ?/sec     1.17     85.5±4.82µs        ? ?/sec
run_criteria/yes/091_systems                                      1.00     80.5±5.07µs        ? ?/sec     1.16     93.4±3.57µs        ? ?/sec
run_criteria/yes/096_systems                                      1.00     88.9±4.41µs        ? ?/sec     1.13    100.3±3.81µs        ? ?/sec
run_criteria/yes/101_systems                                      1.00     94.0±4.28µs        ? ?/sec     1.13    106.2±4.30µs        ? ?/sec
run_criteria/yes_using_query/001_systems                          1.40      5.0±0.06µs        ? ?/sec     1.00      3.6±0.11µs        ? ?/sec
run_criteria/yes_using_query/006_systems                          1.16     10.0±0.88µs        ? ?/sec     1.00      8.6±0.30µs        ? ?/sec
run_criteria/yes_using_query/011_systems                          1.10     14.2±1.46µs        ? ?/sec     1.00     13.0±0.52µs        ? ?/sec
run_criteria/yes_using_query/016_systems                          1.08     19.3±1.08µs        ? ?/sec     1.00     17.9±0.70µs        ? ?/sec
run_criteria/yes_using_query/021_systems                          1.05     23.8±0.90µs        ? ?/sec     1.00     22.7±0.84µs        ? ?/sec
run_criteria/yes_using_query/026_systems                          1.00     27.2±1.50µs        ? ?/sec     1.00     27.3±1.31µs        ? ?/sec
run_criteria/yes_using_query/031_systems                          1.00     31.4±1.73µs        ? ?/sec     1.04     32.5±1.05µs        ? ?/sec
run_criteria/yes_using_query/036_systems                          1.00     33.6±1.66µs        ? ?/sec     1.11     37.2±1.71µs        ? ?/sec
run_criteria/yes_using_query/041_systems                          1.00     37.5±1.74µs        ? ?/sec     1.12     41.9±1.20µs        ? ?/sec
run_criteria/yes_using_query/046_systems                          1.00     41.2±1.73µs        ? ?/sec     1.11     45.8±1.43µs        ? ?/sec
run_criteria/yes_using_query/051_systems                          1.00     45.4±2.20µs        ? ?/sec     1.11     50.3±1.79µs        ? ?/sec
run_criteria/yes_using_query/056_systems                          1.00     51.0±2.21µs        ? ?/sec     1.10     56.0±2.48µs        ? ?/sec
run_criteria/yes_using_query/061_systems                          1.00     53.0±2.94µs        ? ?/sec     1.15     60.8±2.38µs        ? ?/sec
run_criteria/yes_using_query/066_systems                          1.00     61.0±3.29µs        ? ?/sec     1.08     66.2±2.81µs        ? ?/sec
run_criteria/yes_using_query/071_systems                          1.00     64.2±2.73µs        ? ?/sec     1.12     72.0±2.55µs        ? ?/sec
run_criteria/yes_using_query/076_systems                          1.00     69.4±4.16µs        ? ?/sec     1.08     75.0±3.80µs        ? ?/sec
run_criteria/yes_using_query/081_systems                          1.00     75.6±6.09µs        ? ?/sec     1.09     82.6±3.37µs        ? ?/sec
run_criteria/yes_using_query/086_systems                          1.00     74.5±4.36µs        ? ?/sec     1.16     86.2±3.52µs        ? ?/sec
run_criteria/yes_using_query/091_systems                          1.00     79.0±4.72µs        ? ?/sec     1.19     94.3±3.58µs        ? ?/sec
run_criteria/yes_using_query/096_systems                          1.00     86.7±5.70µs        ? ?/sec     1.15    100.0±4.73µs        ? ?/sec
run_criteria/yes_using_query/101_systems                          1.00     95.6±6.36µs        ? ?/sec     1.14    108.8±4.73µs        ? ?/sec
run_criteria/yes_using_resource/001_systems                       1.44      5.0±0.14µs        ? ?/sec     1.00      3.4±0.17µs        ? ?/sec
run_criteria/yes_using_resource/006_systems                       1.16      9.8±0.30µs        ? ?/sec     1.00      8.4±0.35µs        ? ?/sec
run_criteria/yes_using_resource/011_systems                       1.09     14.2±1.27µs        ? ?/sec     1.00     13.0±0.47µs        ? ?/sec
run_criteria/yes_using_resource/016_systems                       1.08     19.4±1.73µs        ? ?/sec     1.00     17.9±0.93µs        ? ?/sec
run_criteria/yes_using_resource/021_systems                       1.03     23.4±1.15µs        ? ?/sec     1.00     22.6±1.01µs        ? ?/sec
run_criteria/yes_using_resource/026_systems                       1.02     27.8±1.05µs        ? ?/sec     1.00     27.2±1.03µs        ? ?/sec
run_criteria/yes_using_resource/031_systems                       1.00     30.6±1.42µs        ? ?/sec     1.06     32.6±1.20µs        ? ?/sec
run_criteria/yes_using_resource/036_systems                       1.00     34.2±1.81µs        ? ?/sec     1.10     37.7±0.84µs        ? ?/sec
run_criteria/yes_using_resource/041_systems                       1.00     38.4±1.82µs        ? ?/sec     1.08     41.5±1.46µs        ? ?/sec
run_criteria/yes_using_resource/046_systems                       1.00     41.8±2.33µs        ? ?/sec     1.12     46.8±1.19µs        ? ?/sec
run_criteria/yes_using_resource/051_systems                       1.00     46.5±2.71µs        ? ?/sec     1.09     50.9±2.29µs        ? ?/sec
run_criteria/yes_using_resource/056_systems                       1.00     50.6±2.67µs        ? ?/sec     1.12     56.6±1.70µs        ? ?/sec
run_criteria/yes_using_resource/061_systems                       1.00     53.0±2.58µs        ? ?/sec     1.14     60.7±3.14µs        ? ?/sec
run_criteria/yes_using_resource/066_systems                       1.00     58.3±3.31µs        ? ?/sec     1.13     66.0±2.87µs        ? ?/sec
run_criteria/yes_using_resource/071_systems                       1.00     62.3±2.30µs        ? ?/sec     1.15     71.7±3.36µs        ? ?/sec
run_criteria/yes_using_resource/076_systems                       1.00     64.5±2.81µs        ? ?/sec     1.19     76.8±2.73µs        ? ?/sec
run_criteria/yes_using_resource/081_systems                       1.00     72.8±4.21µs        ? ?/sec     1.15     83.8±3.25µs        ? ?/sec
run_criteria/yes_using_resource/086_systems                       1.00     80.1±3.25µs        ? ?/sec     1.09     87.6±4.46µs        ? ?/sec
run_criteria/yes_using_resource/091_systems                       1.00     83.1±4.83µs        ? ?/sec     1.14     94.6±4.46µs        ? ?/sec
run_criteria/yes_using_resource/096_systems                       1.00     84.3±4.57µs        ? ?/sec     1.18     99.3±4.05µs        ? ?/sec
run_criteria/yes_using_resource/101_systems                       1.00     94.0±5.18µs        ? ?/sec     1.15    107.8±3.86µs        ? ?/sec
run_criteria/yes_with_labels/001_systems                          1.31      4.8±0.20µs        ? ?/sec     1.00      3.7±0.17µs        ? ?/sec
run_criteria/yes_with_labels/006_systems                          1.18      9.9±0.88µs        ? ?/sec     1.00      8.4±0.36µs        ? ?/sec
run_criteria/yes_with_labels/011_systems                          1.15     14.8±1.14µs        ? ?/sec     1.00     12.9±0.63µs        ? ?/sec
run_criteria/yes_with_labels/016_systems                          1.02     18.3±1.88µs        ? ?/sec     1.00     17.9±0.70µs        ? ?/sec
run_criteria/yes_with_labels/021_systems                          1.00     22.0±1.21µs        ? ?/sec     1.05     23.2±0.98µs        ? ?/sec
run_criteria/yes_with_labels/026_systems                          1.00     26.2±1.59µs        ? ?/sec     1.06     27.7±1.06µs        ? ?/sec
run_criteria/yes_with_labels/031_systems                          1.00     30.6±1.59µs        ? ?/sec     1.07     32.9±0.84µs        ? ?/sec
run_criteria/yes_with_labels/036_systems                          1.00     35.5±1.68µs        ? ?/sec     1.05     37.4±1.39µs        ? ?/sec
run_criteria/yes_with_labels/041_systems                          1.00     39.7±1.80µs        ? ?/sec     1.06     42.1±1.44µs        ? ?/sec
run_criteria/yes_with_labels/046_systems                          1.00     43.3±1.75µs        ? ?/sec     1.09     47.1±1.37µs        ? ?/sec
run_criteria/yes_with_labels/051_systems                          1.00     46.7±2.68µs        ? ?/sec     1.10     51.4±2.63µs        ? ?/sec
run_criteria/yes_with_labels/056_systems                          1.00     51.1±2.30µs        ? ?/sec     1.11     56.9±2.81µs        ? ?/sec
run_criteria/yes_with_labels/061_systems                          1.00     55.6±2.72µs        ? ?/sec     1.11     61.6±2.08µs        ? ?/sec
run_criteria/yes_with_labels/066_systems                          1.00     61.4±2.40µs        ? ?/sec     1.10     67.2±2.88µs        ? ?/sec
run_criteria/yes_with_labels/071_systems                          1.00     66.4±2.49µs        ? ?/sec     1.07     71.2±2.74µs        ? ?/sec
run_criteria/yes_with_labels/076_systems                          1.00     71.7±3.31µs        ? ?/sec     1.05     75.5±3.16µs        ? ?/sec
run_criteria/yes_with_labels/081_systems                          1.00     74.8±3.47µs        ? ?/sec     1.09     81.6±3.02µs        ? ?/sec
run_criteria/yes_with_labels/086_systems                          1.00     80.8±4.52µs        ? ?/sec     1.08     87.6±4.39µs        ? ?/sec
run_criteria/yes_with_labels/091_systems                          1.00     83.6±3.73µs        ? ?/sec     1.12     93.5±4.53µs        ? ?/sec
run_criteria/yes_with_labels/096_systems                          1.00     87.5±4.91µs        ? ?/sec     1.15    101.0±3.96µs        ? ?/sec
run_criteria/yes_with_labels/101_systems                          1.00     99.5±3.51µs        ? ?/sec     1.08    107.7±5.29µs        ? ?/sec
schedule/base                                                     1.00     29.5±2.55µs        ? ?/sec     1.22     36.0±3.42µs        ? ?/sec
sized_commands_0_bytes/2000_commands                              1.00      5.1±0.01µs        ? ?/sec     1.00      5.1±0.01µs        ? ?/sec
sized_commands_0_bytes/4000_commands                              1.06     10.8±1.24µs        ? ?/sec     1.00     10.2±0.07µs        ? ?/sec
sized_commands_0_bytes/6000_commands                              1.00     15.1±0.07µs        ? ?/sec     1.01     15.2±0.05µs        ? ?/sec
sized_commands_0_bytes/8000_commands                              1.00     21.7±2.69µs        ? ?/sec     1.03     22.3±2.86µs        ? ?/sec
sized_commands_12_bytes/2000_commands                             1.00      7.3±0.02µs        ? ?/sec     1.00      7.3±0.02µs        ? ?/sec
sized_commands_12_bytes/4000_commands                             1.00     14.6±0.05µs        ? ?/sec     1.01     14.8±0.06µs        ? ?/sec
sized_commands_12_bytes/6000_commands                             1.01     22.2±0.08µs        ? ?/sec     1.00     22.0±0.13µs        ? ?/sec
sized_commands_12_bytes/8000_commands                             1.00     29.3±0.12µs        ? ?/sec     1.01     29.5±0.13µs        ? ?/sec
sized_commands_512_bytes/2000_commands                            1.00     54.1±1.61µs        ? ?/sec     1.00     54.1±1.99µs        ? ?/sec
sized_commands_512_bytes/4000_commands                            1.00    110.0±7.68µs        ? ?/sec     1.00    109.9±8.01µs        ? ?/sec
sized_commands_512_bytes/6000_commands                            1.02   170.6±26.79µs        ? ?/sec     1.00   167.8±17.82µs        ? ?/sec
sized_commands_512_bytes/8000_commands                            1.01   228.8±29.24µs        ? ?/sec     1.00   227.2±32.21µs        ? ?/sec
spawn_commands/2000_entities                                      1.00    184.2±7.07µs        ? ?/sec     1.00    185.0±9.68µs        ? ?/sec
spawn_commands/4000_entities                                      1.00   367.7±12.78µs        ? ?/sec     1.00   368.2±13.14µs        ? ?/sec
spawn_commands/6000_entities                                      1.00   569.2±39.79µs        ? ?/sec     1.00   568.9±25.74µs        ? ?/sec
spawn_commands/8000_entities                                      1.00   747.1±32.76µs        ? ?/sec     1.02   763.7±64.09µs        ? ?/sec
spawn_world/10000_entities                                        1.00  1014.9±89.99µs        ? ?/sec     1.00  1015.1±86.65µs        ? ?/sec
spawn_world/1000_entities                                         1.00    102.0±7.86µs        ? ?/sec     1.02    103.6±8.68µs        ? ?/sec
spawn_world/100_entities                                          1.03     10.3±1.15µs        ? ?/sec     1.00     10.0±1.03µs        ? ?/sec
spawn_world/10_entities                                           1.00  1024.0±108.61ns        ? ?/sec    1.05  1076.8±141.38ns        ? ?/sec
spawn_world/1_entities                                            1.00    104.1±7.87ns        ? ?/sec     1.07   110.9±15.71ns        ? ?/sec
world_entity/50000_entities                                       1.27    120.3±0.17µs        ? ?/sec     1.00     94.5±0.50µs        ? ?/sec
world_get/50000_entities_sparse                                   1.00    239.9±1.07µs        ? ?/sec     1.47    353.4±2.22µs        ? ?/sec
world_get/50000_entities_table                                    1.00    207.4±3.96µs        ? ?/sec     1.77   367.2±13.91µs        ? ?/sec
world_query_for_each/50000_entities_sparse                        1.00     47.3±0.14µs        ? ?/sec     1.01     47.6±0.50µs        ? ?/sec
world_query_for_each/50000_entities_table                         1.00     27.2±0.05µs        ? ?/sec     1.00     27.2±0.20µs        ? ?/sec
world_query_get/50000_entities_sparse                             1.00     95.9±0.98µs        ? ?/sec     1.70    162.7±1.44µs        ? ?/sec
world_query_get/50000_entities_sparse_wide                        1.00    191.3±1.04µs        ? ?/sec     1.27    242.1±0.99µs        ? ?/sec
world_query_get/50000_entities_table                              1.00    157.5±1.15µs        ? ?/sec     1.17    184.7±2.29µs        ? ?/sec
world_query_get/50000_entities_table_wide                         1.00    234.3±4.74µs        ? ?/sec     1.05    245.6±1.18µs        ? ?/sec
world_query_iter/50000_entities_sparse                            1.00     54.2±0.40µs        ? ?/sec     1.01     54.7±0.20µs        ? ?/sec
world_query_iter/50000_entities_table                             1.00     27.2±0.51µs        ? ?/sec     1.00     27.2±0.07µs        ? ?/sec

@james7132 james7132 removed the S-Needs-Benchmarking This set of changes needs performance benchmarking to double-check that they help label Nov 18, 2022
@james7132 james7132 marked this pull request as ready for review November 18, 2022 19:02
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking, the changes I saw made sense. The cleanup would be nice, but we can keep this PR small.

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New docs look great, thanks! Fine to defer the rest of the work.

@james7132
Copy link
Member Author

james7132 commented Nov 19, 2022

Did a quick check on the stress tests. Here are the frame times I'm seeing.

test main PR Diff
many_cubes 14.53ms 13.95ms -3.99%
many_foxes 8.36ms 8.15ms -2.51%

@james7132 james7132 added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Nov 20, 2022
@james7132
Copy link
Member Author

Reran microbenchmarks after #4878 and #6800 to ensure nothing changed. The wins from before are retained.

group                                          flatten-entity-location                 main
-----                                          -----------------------                 ----
add_remove/sparse_set                          1.04  1049.8±74.11µs        ? ?/sec     1.00  1004.7±69.60µs        ? ?/sec
add_remove/table                               1.06  1407.4±14.96µs        ? ?/sec     1.00   1328.3±9.10µs        ? ?/sec
add_remove_big/sparse_set                      1.02  1151.5±242.20µs        ? ?/sec    1.00  1133.2±331.26µs        ? ?/sec
add_remove_big/table                           1.00      2.6±0.07ms        ? ?/sec     1.00      2.6±0.04ms        ? ?/sec
added_archetypes/archetype_count/100           1.06    134.4±6.29µs        ? ?/sec     1.00    126.4±6.60µs        ? ?/sec
added_archetypes/archetype_count/1000          1.01   643.5±17.21µs        ? ?/sec     1.00   639.3±38.35µs        ? ?/sec
added_archetypes/archetype_count/10000         1.01      9.3±0.41ms        ? ?/sec     1.00      9.2±1.01ms        ? ?/sec
added_archetypes/archetype_count/200           1.03    194.3±6.29µs        ? ?/sec     1.00    189.5±7.49µs        ? ?/sec
added_archetypes/archetype_count/2000          1.00  1231.3±23.42µs        ? ?/sec     1.16  1424.5±168.99µs        ? ?/sec
added_archetypes/archetype_count/500           1.05   377.7±16.54µs        ? ?/sec     1.00   358.4±18.99µs        ? ?/sec
added_archetypes/archetype_count/5000          1.00      3.4±0.18ms        ? ?/sec     1.01      3.4±0.37ms        ? ?/sec
build_schedule/1000_schedule                   1.00    349.8±7.95ms        ? ?/sec     1.00    350.4±9.85ms        ? ?/sec
build_schedule/1000_schedule_noconstraints     1.01      4.5±0.05ms        ? ?/sec     1.00      4.5±0.09ms        ? ?/sec
build_schedule/100_schedule                    1.01      2.0±0.02ms        ? ?/sec     1.00  1994.6±22.97µs        ? ?/sec
build_schedule/100_schedule_noconstraints      1.00    157.1±4.08µs        ? ?/sec     1.01    158.0±4.41µs        ? ?/sec
build_schedule/500_schedule                    1.00     64.9±1.35ms        ? ?/sec     1.01     65.8±3.03ms        ? ?/sec
build_schedule/500_schedule_noconstraints      1.02  1961.9±27.75µs        ? ?/sec     1.00  1927.1±47.51µs        ? ?/sec
busy_systems/01x_entities_03_systems           1.04     21.5±1.23µs        ? ?/sec     1.00     20.7±1.28µs        ? ?/sec
busy_systems/01x_entities_06_systems           1.06     49.4±2.08µs        ? ?/sec     1.00     46.7±5.36µs        ? ?/sec
busy_systems/01x_entities_09_systems           1.02     70.8±2.90µs        ? ?/sec     1.00     69.3±3.54µs        ? ?/sec
busy_systems/01x_entities_12_systems           1.00     87.0±3.66µs        ? ?/sec     1.03     89.6±5.62µs        ? ?/sec
busy_systems/01x_entities_15_systems           1.02    106.1±3.69µs        ? ?/sec     1.00    104.1±4.06µs        ? ?/sec
busy_systems/02x_entities_03_systems           1.00     35.1±0.99µs        ? ?/sec     1.16     40.8±1.45µs        ? ?/sec
busy_systems/02x_entities_06_systems           1.07     80.7±3.07µs        ? ?/sec     1.00     75.2±5.10µs        ? ?/sec
busy_systems/02x_entities_09_systems           1.05    120.6±5.41µs        ? ?/sec     1.00   114.6±12.14µs        ? ?/sec
busy_systems/02x_entities_12_systems           1.04    162.1±6.22µs        ? ?/sec     1.00   156.2±19.70µs        ? ?/sec
busy_systems/02x_entities_15_systems           1.00    186.6±7.97µs        ? ?/sec     1.01    188.3±6.81µs        ? ?/sec
busy_systems/03x_entities_03_systems           1.01     51.1±1.99µs        ? ?/sec     1.00     50.6±2.62µs        ? ?/sec
busy_systems/03x_entities_06_systems           1.00    110.3±3.52µs        ? ?/sec     1.01   111.2±11.16µs        ? ?/sec
busy_systems/03x_entities_09_systems           1.02    173.1±7.88µs        ? ?/sec     1.00   170.3±16.87µs        ? ?/sec
busy_systems/03x_entities_12_systems           1.05    221.9±8.97µs        ? ?/sec     1.00   210.5±12.87µs        ? ?/sec
busy_systems/03x_entities_15_systems           1.00   271.4±12.96µs        ? ?/sec     1.02   277.4±18.69µs        ? ?/sec
busy_systems/04x_entities_03_systems           1.21     88.0±6.45µs        ? ?/sec     1.00     72.9±4.43µs        ? ?/sec
busy_systems/04x_entities_06_systems           1.02    155.0±7.05µs        ? ?/sec     1.00   152.6±11.06µs        ? ?/sec
busy_systems/04x_entities_09_systems           1.00   224.8±10.38µs        ? ?/sec     1.04   233.7±23.23µs        ? ?/sec
busy_systems/04x_entities_12_systems           1.00   291.3±14.43µs        ? ?/sec     1.04   302.7±26.43µs        ? ?/sec
busy_systems/04x_entities_15_systems           1.00   341.1±11.82µs        ? ?/sec     1.02   347.9±19.48µs        ? ?/sec
busy_systems/05x_entities_03_systems           1.00     79.3±1.73µs        ? ?/sec     1.22     96.9±5.35µs        ? ?/sec
busy_systems/05x_entities_06_systems           1.06   185.5±11.96µs        ? ?/sec     1.00    175.6±9.26µs        ? ?/sec
busy_systems/05x_entities_09_systems           1.00    250.5±8.98µs        ? ?/sec     1.00    250.5±6.18µs        ? ?/sec
busy_systems/05x_entities_12_systems           1.00   331.5±11.88µs        ? ?/sec     1.09   360.4±20.30µs        ? ?/sec
busy_systems/05x_entities_15_systems           1.00   407.5±14.59µs        ? ?/sec     1.03   419.9±13.68µs        ? ?/sec
contrived/01x_entities_03_systems              1.05     14.9±0.89µs        ? ?/sec     1.00     14.2±0.93µs        ? ?/sec
contrived/01x_entities_06_systems              1.04     28.7±1.78µs        ? ?/sec     1.00     27.7±2.08µs        ? ?/sec
contrived/01x_entities_09_systems              1.07     44.1±2.33µs        ? ?/sec     1.00     41.2±3.33µs        ? ?/sec
contrived/01x_entities_12_systems              1.10     62.6±3.02µs        ? ?/sec     1.00     56.8±5.60µs        ? ?/sec
contrived/01x_entities_15_systems              1.04     73.9±3.15µs        ? ?/sec     1.00     71.2±6.68µs        ? ?/sec
contrived/02x_entities_03_systems              1.00     25.7±2.09µs        ? ?/sec     1.00     25.6±2.21µs        ? ?/sec
contrived/02x_entities_06_systems              1.09     46.9±1.33µs        ? ?/sec     1.00     43.1±2.20µs        ? ?/sec
contrived/02x_entities_09_systems              1.05     70.0±3.50µs        ? ?/sec     1.00     66.9±5.77µs        ? ?/sec
contrived/02x_entities_12_systems              1.00     91.2±2.49µs        ? ?/sec     1.02     93.0±7.93µs        ? ?/sec
contrived/02x_entities_15_systems              1.05    112.9±7.75µs        ? ?/sec     1.00    107.9±5.63µs        ? ?/sec
contrived/03x_entities_03_systems              1.01     33.4±2.13µs        ? ?/sec     1.00     33.0±3.21µs        ? ?/sec
contrived/03x_entities_06_systems              1.09     62.8±3.60µs        ? ?/sec     1.00     57.5±3.61µs        ? ?/sec
contrived/03x_entities_09_systems              1.12     95.3±5.41µs        ? ?/sec     1.00     85.4±6.96µs        ? ?/sec
contrived/03x_entities_12_systems              1.12    120.8±5.95µs        ? ?/sec     1.00    108.2±3.55µs        ? ?/sec
contrived/03x_entities_15_systems              1.12    151.7±5.81µs        ? ?/sec     1.00    135.9±6.77µs        ? ?/sec
contrived/04x_entities_03_systems              1.09     40.6±2.70µs        ? ?/sec     1.00     37.2±2.77µs        ? ?/sec
contrived/04x_entities_06_systems              1.13     79.8±2.21µs        ? ?/sec     1.00     70.6±5.14µs        ? ?/sec
contrived/04x_entities_09_systems              1.18    123.2±4.04µs        ? ?/sec     1.00    104.7±3.31µs        ? ?/sec
contrived/04x_entities_12_systems              1.13    156.9±6.05µs        ? ?/sec     1.00    138.7±9.09µs        ? ?/sec
contrived/04x_entities_15_systems              1.11    187.5±6.29µs        ? ?/sec     1.00    169.3±5.55µs        ? ?/sec
contrived/05x_entities_03_systems              1.02     47.2±2.40µs        ? ?/sec     1.00     46.2±4.02µs        ? ?/sec
contrived/05x_entities_06_systems              1.10     90.9±5.66µs        ? ?/sec     1.00     82.5±5.21µs        ? ?/sec
contrived/05x_entities_09_systems              1.13    138.8±5.56µs        ? ?/sec     1.00    122.9±4.41µs        ? ?/sec
contrived/05x_entities_12_systems              1.16    193.5±7.99µs        ? ?/sec     1.00    166.7±7.35µs        ? ?/sec
contrived/05x_entities_15_systems              1.04    233.4±7.63µs        ? ?/sec     1.00   223.4±19.46µs        ? ?/sec
empty_commands/0_entities                      1.18      6.1±0.04ns        ? ?/sec     1.00      5.2±0.03ns        ? ?/sec
empty_systems/000_systems                      1.02     75.9±0.22ns        ? ?/sec     1.00     74.8±0.23ns        ? ?/sec
empty_systems/001_systems                      1.02      3.5±0.07µs        ? ?/sec     1.00      3.5±0.09µs        ? ?/sec
empty_systems/002_systems                      1.00      4.4±0.25µs        ? ?/sec     1.01      4.5±0.14µs        ? ?/sec
empty_systems/003_systems                      1.01      5.2±0.24µs        ? ?/sec     1.00      5.2±0.26µs        ? ?/sec
empty_systems/004_systems                      1.04      6.1±0.24µs        ? ?/sec     1.00      5.9±0.30µs        ? ?/sec
empty_systems/005_systems                      1.00      6.8±0.40µs        ? ?/sec     1.05      7.1±0.33µs        ? ?/sec
empty_systems/010_systems                      1.04     11.7±0.78µs        ? ?/sec     1.00     11.3±1.02µs        ? ?/sec
empty_systems/015_systems                      1.05     16.4±0.99µs        ? ?/sec     1.00     15.6±1.26µs        ? ?/sec
empty_systems/020_systems                      1.05     20.1±0.88µs        ? ?/sec     1.00     19.3±1.42µs        ? ?/sec
empty_systems/025_systems                      1.07     23.9±1.25µs        ? ?/sec     1.00     22.4±1.36µs        ? ?/sec
empty_systems/030_systems                      1.03     28.2±1.23µs        ? ?/sec     1.00     27.4±1.40µs        ? ?/sec
empty_systems/035_systems                      1.00     31.3±1.23µs        ? ?/sec     1.03     32.2±1.30µs        ? ?/sec
empty_systems/040_systems                      1.01     34.6±2.00µs        ? ?/sec     1.00     34.1±1.98µs        ? ?/sec
empty_systems/045_systems                      1.01     38.1±2.38µs        ? ?/sec     1.00     37.6±1.26µs        ? ?/sec
empty_systems/050_systems                      1.00     40.7±1.47µs        ? ?/sec     1.03     41.7±1.83µs        ? ?/sec
empty_systems/055_systems                      1.01     45.7±1.81µs        ? ?/sec     1.00     45.0±2.73µs        ? ?/sec
empty_systems/060_systems                      1.00     47.7±1.78µs        ? ?/sec     1.06     50.8±1.92µs        ? ?/sec
empty_systems/065_systems                      1.00     52.2±2.47µs        ? ?/sec     1.02     53.3±2.47µs        ? ?/sec
empty_systems/070_systems                      1.00     56.5±3.41µs        ? ?/sec     1.03     58.0±2.41µs        ? ?/sec
empty_systems/075_systems                      1.00     55.8±2.41µs        ? ?/sec     1.12     62.5±2.56µs        ? ?/sec
empty_systems/080_systems                      1.00     62.9±2.32µs        ? ?/sec     1.09     68.3±3.13µs        ? ?/sec
empty_systems/085_systems                      1.00     68.5±2.77µs        ? ?/sec     1.03     70.8±3.93µs        ? ?/sec
empty_systems/090_systems                      1.01     76.2±3.87µs        ? ?/sec     1.00     75.3±3.37µs        ? ?/sec
empty_systems/095_systems                      1.02     78.9±3.63µs        ? ?/sec     1.00     77.0±3.39µs        ? ?/sec
empty_systems/100_systems                      1.02     82.1±4.38µs        ? ?/sec     1.00     80.3±6.93µs        ? ?/sec
fake_commands/2000_commands                    1.00      7.2±0.03µs        ? ?/sec     1.00      7.2±0.02µs        ? ?/sec
fake_commands/4000_commands                    1.01     14.5±0.08µs        ? ?/sec     1.00     14.4±0.05µs        ? ?/sec
fake_commands/6000_commands                    1.03     22.2±0.13µs        ? ?/sec     1.00     21.5±0.09µs        ? ?/sec
fake_commands/8000_commands                    1.00     28.9±0.12µs        ? ?/sec     1.00     28.8±0.08µs        ? ?/sec
get_or_spawn/batched                           1.08   431.1±17.39µs        ? ?/sec     1.00   400.5±23.34µs        ? ?/sec
get_or_spawn/individual                        1.03   734.7±42.10µs        ? ?/sec     1.00   712.1±40.18µs        ? ?/sec
heavy_compute/base                             1.00    293.2±2.87µs        ? ?/sec     1.03    302.1±9.06µs        ? ?/sec
insert_commands/insert                         1.00   613.4±35.79µs        ? ?/sec     1.05   643.4±36.05µs        ? ?/sec
insert_commands/insert_batch                   1.08   436.5±40.49µs        ? ?/sec     1.00   405.2±23.09µs        ? ?/sec
insert_simple/base                             1.07    443.6±2.58µs        ? ?/sec     1.00    414.7±3.35µs        ? ?/sec
insert_simple/unbatched                        1.07    975.4±9.66µs        ? ?/sec     1.00   914.3±12.08µs        ? ?/sec
iter_fragmented/base                           1.00    344.9±5.74ns        ? ?/sec     1.00    344.7±5.36ns        ? ?/sec
iter_fragmented/foreach                        1.05   174.6±30.86ns        ? ?/sec     1.00   167.0±22.84ns        ? ?/sec
iter_fragmented/foreach_wide                   1.00      3.9±0.18µs        ? ?/sec     1.01      3.9±0.20µs        ? ?/sec
iter_fragmented/wide                           1.03      4.0±0.10µs        ? ?/sec     1.00      3.9±0.16µs        ? ?/sec
iter_fragmented_sparse/base                    1.00      8.6±0.44ns        ? ?/sec     1.09      9.3±0.94ns        ? ?/sec
iter_fragmented_sparse/foreach                 1.00      7.8±0.16ns        ? ?/sec     1.02      7.9±0.42ns        ? ?/sec
iter_fragmented_sparse/foreach_wide            1.02     39.8±1.39ns        ? ?/sec     1.00     39.0±0.88ns        ? ?/sec
iter_fragmented_sparse/wide                    1.71    72.1±13.82ns        ? ?/sec     1.00     42.1±1.10ns        ? ?/sec
iter_simple/base                               1.00      8.4±0.05µs        ? ?/sec     1.02      8.6±0.03µs        ? ?/sec
iter_simple/foreach                            1.02      8.4±0.14µs        ? ?/sec     1.00      8.2±0.04µs        ? ?/sec
iter_simple/foreach_sparse_set                 1.00     25.9±0.16µs        ? ?/sec     1.00     25.7±0.10µs        ? ?/sec
iter_simple/foreach_wide                       1.07     42.3±1.32µs        ? ?/sec     1.00     39.5±0.88µs        ? ?/sec
iter_simple/foreach_wide_sparse_set            1.01    116.2±1.42µs        ? ?/sec     1.00    114.6±1.25µs        ? ?/sec
iter_simple/sparse_set                         1.01     28.4±0.21µs        ? ?/sec     1.00     28.2±0.16µs        ? ?/sec
iter_simple/system                             1.01      8.3±0.06µs        ? ?/sec     1.00      8.2±0.05µs        ? ?/sec
iter_simple/wide                               1.07     42.6±0.94µs        ? ?/sec     1.00     39.8±1.12µs        ? ?/sec
iter_simple/wide_sparse_set                    1.00    122.5±1.34µs        ? ?/sec     1.02    124.7±1.16µs        ? ?/sec
no_archetypes/system_count/0                   1.00     70.9±0.42ns        ? ?/sec     1.06     74.9±0.31ns        ? ?/sec
no_archetypes/system_count/100                 1.00     76.2±3.99µs        ? ?/sec     1.03     78.2±2.62µs        ? ?/sec
no_archetypes/system_count/20                  1.00     19.3±1.18µs        ? ?/sec     1.03     19.8±1.16µs        ? ?/sec
no_archetypes/system_count/40                  1.00     32.5±1.45µs        ? ?/sec     1.02     33.1±1.30µs        ? ?/sec
no_archetypes/system_count/60                  1.00     47.1±2.11µs        ? ?/sec     1.01     47.8±2.08µs        ? ?/sec
no_archetypes/system_count/80                  1.00     59.8±2.01µs        ? ?/sec     1.02     61.0±2.74µs        ? ?/sec
query_get/50000_entities_sparse                1.00    322.7±6.96µs        ? ?/sec     1.16   374.2±16.83µs        ? ?/sec
query_get/50000_entities_table                 1.00    282.4±0.89µs        ? ?/sec     1.70   479.0±14.13µs        ? ?/sec
query_get_component/50000_entities_sparse      1.00    893.3±9.19µs        ? ?/sec     1.02  913.6±130.84µs        ? ?/sec
query_get_component/50000_entities_table       1.00    674.8±4.36µs        ? ?/sec     1.63  1103.1±68.50µs        ? ?/sec
query_get_component_simple/system              1.00    581.8±7.20µs        ? ?/sec     1.15    669.9±7.99µs        ? ?/sec
query_get_component_simple/unchecked           1.00   777.3±11.55µs        ? ?/sec     1.10    858.3±6.09µs        ? ?/sec
query_get_many_10/50000_calls_sparse           1.00      4.4±0.41ms        ? ?/sec     1.17      5.2±0.66ms        ? ?/sec
query_get_many_10/50000_calls_table            1.00      4.1±0.33ms        ? ?/sec     1.45      5.9±0.55ms        ? ?/sec
query_get_many_2/50000_calls_sparse            1.00   666.0±89.95µs        ? ?/sec     1.20   797.6±63.12µs        ? ?/sec
query_get_many_2/50000_calls_table             1.00   679.3±40.27µs        ? ?/sec     1.55  1049.8±189.01µs        ? ?/sec
query_get_many_5/50000_calls_sparse            1.00  1989.3±183.36µs        ? ?/sec    1.15      2.3±0.34ms        ? ?/sec
query_get_many_5/50000_calls_table             1.00  1802.3±104.34µs        ? ?/sec    1.43      2.6±0.46ms        ? ?/sec
run_criteria/no/001_systems                    1.00     95.1±0.54ns        ? ?/sec     1.11    106.0±0.84ns        ? ?/sec
run_criteria/no/006_systems                    1.00    179.8±2.95ns        ? ?/sec     1.01    181.3±1.80ns        ? ?/sec
run_criteria/no/011_systems                    1.00    259.4±5.07ns        ? ?/sec     1.03    265.9±1.86ns        ? ?/sec
run_criteria/no/016_systems                    1.00    339.3±2.23ns        ? ?/sec     1.07    364.4±2.45ns        ? ?/sec
run_criteria/no/021_systems                    1.00    421.6±4.98ns        ? ?/sec     1.00    423.5±4.19ns        ? ?/sec
run_criteria/no/026_systems                    1.05    524.7±3.95ns        ? ?/sec     1.00    500.6±2.96ns        ? ?/sec
run_criteria/no/031_systems                    1.00    577.7±2.35ns        ? ?/sec     1.03    595.7±3.85ns        ? ?/sec
run_criteria/no/036_systems                    1.00    691.8±4.27ns        ? ?/sec     1.04    720.4±0.85ns        ? ?/sec
run_criteria/no/041_systems                    1.00    792.2±5.08ns        ? ?/sec     1.01    799.3±6.37ns        ? ?/sec
run_criteria/no/046_systems                    1.03    916.4±7.30ns        ? ?/sec     1.00    891.9±1.31ns        ? ?/sec
run_criteria/no/051_systems                    1.02   1012.2±9.24ns        ? ?/sec     1.00    987.6±7.83ns        ? ?/sec
run_criteria/no/056_systems                    1.02  1109.4±10.60ns        ? ?/sec     1.00   1083.8±7.18ns        ? ?/sec
run_criteria/no/061_systems                    1.02   1190.6±4.69ns        ? ?/sec     1.00   1169.3±3.13ns        ? ?/sec
run_criteria/no/066_systems                    1.06   1331.4±5.94ns        ? ?/sec     1.00   1260.2±2.95ns        ? ?/sec
run_criteria/no/071_systems                    1.04   1406.5±8.37ns        ? ?/sec     1.00   1350.3±4.23ns        ? ?/sec
run_criteria/no/076_systems                    1.05   1508.6±8.21ns        ? ?/sec     1.00   1437.9±5.47ns        ? ?/sec
run_criteria/no/081_systems                    1.03   1589.4±9.54ns        ? ?/sec     1.00   1537.4±4.17ns        ? ?/sec
run_criteria/no/086_systems                    1.03   1673.8±8.41ns        ? ?/sec     1.00   1623.2±5.38ns        ? ?/sec
run_criteria/no/091_systems                    1.03  1761.1±13.28ns        ? ?/sec     1.00  1716.0±12.31ns        ? ?/sec
run_criteria/no/096_systems                    1.02  1829.2±20.89ns        ? ?/sec     1.00   1799.5±3.70ns        ? ?/sec
run_criteria/no/101_systems                    1.02  1941.5±10.52ns        ? ?/sec     1.00   1905.3±3.12ns        ? ?/sec
run_criteria/no_with_labels/001_systems        1.00     98.8±0.53ns        ? ?/sec     1.11    109.4±0.27ns        ? ?/sec
run_criteria/no_with_labels/006_systems        1.00    154.8±0.85ns        ? ?/sec     1.04    160.7±0.46ns        ? ?/sec
run_criteria/no_with_labels/011_systems        1.00    216.1±1.25ns        ? ?/sec     1.02    219.8±0.32ns        ? ?/sec
run_criteria/no_with_labels/016_systems        1.00    277.0±1.83ns        ? ?/sec     1.01    280.4±2.08ns        ? ?/sec
run_criteria/no_with_labels/021_systems        1.00    339.8±6.96ns        ? ?/sec     1.01    342.8±4.19ns        ? ?/sec
run_criteria/no_with_labels/026_systems        1.00    401.8±2.45ns        ? ?/sec     1.01    405.1±1.03ns        ? ?/sec
run_criteria/no_with_labels/031_systems        1.01    468.6±5.92ns        ? ?/sec     1.00    463.2±0.83ns        ? ?/sec
run_criteria/no_with_labels/036_systems        1.02    543.4±3.07ns        ? ?/sec     1.00    533.0±1.25ns        ? ?/sec
run_criteria/no_with_labels/041_systems        1.01    602.4±6.35ns        ? ?/sec     1.00    594.1±2.01ns        ? ?/sec
run_criteria/no_with_labels/046_systems        1.02    663.4±5.79ns        ? ?/sec     1.00    653.4±0.73ns        ? ?/sec
run_criteria/no_with_labels/051_systems        1.03    732.9±7.50ns        ? ?/sec     1.00    709.1±1.27ns        ? ?/sec
run_criteria/no_with_labels/056_systems        1.00    772.4±4.59ns        ? ?/sec     1.00    772.0±1.06ns        ? ?/sec
run_criteria/no_with_labels/061_systems        1.01    846.5±5.89ns        ? ?/sec     1.00    834.8±1.76ns        ? ?/sec
run_criteria/no_with_labels/066_systems        1.02    928.4±4.56ns        ? ?/sec     1.00    911.9±3.24ns        ? ?/sec
run_criteria/no_with_labels/071_systems        1.02    985.7±5.74ns        ? ?/sec     1.00    970.3±3.00ns        ? ?/sec
run_criteria/no_with_labels/076_systems        1.01   1035.6±6.63ns        ? ?/sec     1.00   1024.7±6.20ns        ? ?/sec
run_criteria/no_with_labels/081_systems        1.04   1128.5±7.90ns        ? ?/sec     1.00   1090.3±5.13ns        ? ?/sec
run_criteria/no_with_labels/086_systems        1.03   1179.0±8.15ns        ? ?/sec     1.00   1144.4±6.29ns        ? ?/sec
run_criteria/no_with_labels/091_systems        1.02  1230.6±10.63ns        ? ?/sec     1.00   1202.6±5.41ns        ? ?/sec
run_criteria/no_with_labels/096_systems        1.01   1294.0±9.34ns        ? ?/sec     1.00   1280.9±2.53ns        ? ?/sec
run_criteria/no_with_labels/101_systems        1.03  1371.2±13.52ns        ? ?/sec     1.00   1333.2±1.77ns        ? ?/sec
run_criteria/yes/001_systems                   1.04      3.4±0.10µs        ? ?/sec     1.00      3.2±0.10µs        ? ?/sec
run_criteria/yes/006_systems                   1.00      8.2±0.39µs        ? ?/sec     1.00      8.3±0.40µs        ? ?/sec
run_criteria/yes/011_systems                   1.04     12.8±0.92µs        ? ?/sec     1.00     12.4±0.86µs        ? ?/sec
run_criteria/yes/016_systems                   1.04     16.8±1.15µs        ? ?/sec     1.00     16.2±1.09µs        ? ?/sec
run_criteria/yes/021_systems                   1.06     21.0±1.68µs        ? ?/sec     1.00     19.7±1.21µs        ? ?/sec
run_criteria/yes/026_systems                   1.02     23.8±1.44µs        ? ?/sec     1.00     23.4±1.33µs        ? ?/sec
run_criteria/yes/031_systems                   1.06     28.1±1.43µs        ? ?/sec     1.00     26.5±1.64µs        ? ?/sec
run_criteria/yes/036_systems                   1.04     31.0±1.55µs        ? ?/sec     1.00     29.7±1.49µs        ? ?/sec
run_criteria/yes/041_systems                   1.01     34.4±1.45µs        ? ?/sec     1.00     34.0±1.85µs        ? ?/sec
run_criteria/yes/046_systems                   1.05     38.0±1.79µs        ? ?/sec     1.00     36.2±1.94µs        ? ?/sec
run_criteria/yes/051_systems                   1.03     42.3±2.20µs        ? ?/sec     1.00     41.2±1.97µs        ? ?/sec
run_criteria/yes/056_systems                   1.04     45.3±2.07µs        ? ?/sec     1.00     43.7±2.25µs        ? ?/sec
run_criteria/yes/061_systems                   1.02     48.2±2.28µs        ? ?/sec     1.00     47.1±2.04µs        ? ?/sec
run_criteria/yes/066_systems                   1.00     51.0±2.40µs        ? ?/sec     1.02     52.0±3.22µs        ? ?/sec
run_criteria/yes/071_systems                   1.00     53.1±2.92µs        ? ?/sec     1.04     55.5±1.85µs        ? ?/sec
run_criteria/yes/076_systems                   1.00     56.9±2.79µs        ? ?/sec     1.04     59.4±2.37µs        ? ?/sec
run_criteria/yes/081_systems                   1.02     63.0±3.58µs        ? ?/sec     1.00     61.9±2.46µs        ? ?/sec
run_criteria/yes/086_systems                   1.00     66.7±2.69µs        ? ?/sec     1.02     67.9±3.47µs        ? ?/sec
run_criteria/yes/091_systems                   1.04     70.7±3.79µs        ? ?/sec     1.00     68.0±3.58µs        ? ?/sec
run_criteria/yes/096_systems                   1.07     76.0±4.14µs        ? ?/sec     1.00     70.8±4.16µs        ? ?/sec
run_criteria/yes/101_systems                   1.00     77.7±3.38µs        ? ?/sec     1.01     78.7±4.53µs        ? ?/sec
run_criteria/yes_using_query/001_systems       1.02      3.4±0.11µs        ? ?/sec     1.00      3.3±0.10µs        ? ?/sec
run_criteria/yes_using_query/006_systems       1.07      8.3±0.34µs        ? ?/sec     1.00      7.7±0.36µs        ? ?/sec
run_criteria/yes_using_query/011_systems       1.08     13.0±0.58µs        ? ?/sec     1.00     12.0±0.80µs        ? ?/sec
run_criteria/yes_using_query/016_systems       1.03     17.2±0.90µs        ? ?/sec     1.00     16.7±0.85µs        ? ?/sec
run_criteria/yes_using_query/021_systems       1.02     21.2±1.10µs        ? ?/sec     1.00     20.8±1.35µs        ? ?/sec
run_criteria/yes_using_query/026_systems       1.00     24.2±1.39µs        ? ?/sec     1.00     24.1±1.52µs        ? ?/sec
run_criteria/yes_using_query/031_systems       1.00     28.2±1.50µs        ? ?/sec     1.01     28.4±1.78µs        ? ?/sec
run_criteria/yes_using_query/036_systems       1.00     30.8±1.27µs        ? ?/sec     1.04     32.1±1.51µs        ? ?/sec
run_criteria/yes_using_query/041_systems       1.00     34.6±1.36µs        ? ?/sec     1.03     35.5±1.84µs        ? ?/sec
run_criteria/yes_using_query/046_systems       1.00     36.6±2.42µs        ? ?/sec     1.07     39.2±2.18µs        ? ?/sec
run_criteria/yes_using_query/051_systems       1.00     40.6±2.48µs        ? ?/sec     1.02     41.4±2.36µs        ? ?/sec
run_criteria/yes_using_query/056_systems       1.00     42.8±2.16µs        ? ?/sec     1.04     44.7±2.48µs        ? ?/sec
run_criteria/yes_using_query/061_systems       1.00     47.9±2.56µs        ? ?/sec     1.03     49.3±2.59µs        ? ?/sec
run_criteria/yes_using_query/066_systems       1.02     51.7±2.31µs        ? ?/sec     1.00     50.8±2.71µs        ? ?/sec
run_criteria/yes_using_query/071_systems       1.02     55.7±2.59µs        ? ?/sec     1.00     54.8±3.93µs        ? ?/sec
run_criteria/yes_using_query/076_systems       1.00     58.3±2.24µs        ? ?/sec     1.02     59.3±3.24µs        ? ?/sec
run_criteria/yes_using_query/081_systems       1.00     62.1±3.36µs        ? ?/sec     1.00     61.9±2.94µs        ? ?/sec
run_criteria/yes_using_query/086_systems       1.00     66.5±3.44µs        ? ?/sec     1.04     69.2±3.83µs        ? ?/sec
run_criteria/yes_using_query/091_systems       1.00     70.1±5.28µs        ? ?/sec     1.00     70.3±5.54µs        ? ?/sec
run_criteria/yes_using_query/096_systems       1.02     76.0±4.13µs        ? ?/sec     1.00     74.4±4.39µs        ? ?/sec
run_criteria/yes_using_query/101_systems       1.03     82.8±4.45µs        ? ?/sec     1.00     80.2±4.47µs        ? ?/sec
run_criteria/yes_using_resource/001_systems    1.00      3.3±0.12µs        ? ?/sec     1.00      3.3±0.32µs        ? ?/sec
run_criteria/yes_using_resource/006_systems    1.00      8.4±0.34µs        ? ?/sec     1.02      8.5±0.28µs        ? ?/sec
run_criteria/yes_using_resource/011_systems    1.03     13.5±0.66µs        ? ?/sec     1.00     13.2±1.12µs        ? ?/sec
run_criteria/yes_using_resource/016_systems    1.04     17.4±1.31µs        ? ?/sec     1.00     16.7±1.32µs        ? ?/sec
run_criteria/yes_using_resource/021_systems    1.04     20.9±0.96µs        ? ?/sec     1.00     20.2±1.38µs        ? ?/sec
run_criteria/yes_using_resource/026_systems    1.06     24.6±1.63µs        ? ?/sec     1.00     23.3±1.46µs        ? ?/sec
run_criteria/yes_using_resource/031_systems    1.00     27.7±1.41µs        ? ?/sec     1.02     28.1±1.65µs        ? ?/sec
run_criteria/yes_using_resource/036_systems    1.02     31.8±1.74µs        ? ?/sec     1.00     31.3±1.58µs        ? ?/sec
run_criteria/yes_using_resource/041_systems    1.01     34.6±1.81µs        ? ?/sec     1.00     34.3±1.56µs        ? ?/sec
run_criteria/yes_using_resource/046_systems    1.02     38.1±1.53µs        ? ?/sec     1.00     37.3±1.88µs        ? ?/sec
run_criteria/yes_using_resource/051_systems    1.00     42.3±2.02µs        ? ?/sec     1.00     42.3±1.81µs        ? ?/sec
run_criteria/yes_using_resource/056_systems    1.03     47.9±1.60µs        ? ?/sec     1.00     46.4±2.32µs        ? ?/sec
run_criteria/yes_using_resource/061_systems    1.00     49.7±2.22µs        ? ?/sec     1.00     49.5±1.87µs        ? ?/sec
run_criteria/yes_using_resource/066_systems    1.00     53.5±2.34µs        ? ?/sec     1.00     53.5±2.89µs        ? ?/sec
run_criteria/yes_using_resource/071_systems    1.00     57.8±2.66µs        ? ?/sec     1.01     58.6±2.47µs        ? ?/sec
run_criteria/yes_using_resource/076_systems    1.00     61.6±2.78µs        ? ?/sec     1.01     62.3±3.64µs        ? ?/sec
run_criteria/yes_using_resource/081_systems    1.00     64.7±2.77µs        ? ?/sec     1.03     66.7±3.12µs        ? ?/sec
run_criteria/yes_using_resource/086_systems    1.01     68.0±2.72µs        ? ?/sec     1.00     67.4±5.38µs        ? ?/sec
run_criteria/yes_using_resource/091_systems    1.02     74.0±3.65µs        ? ?/sec     1.00     72.7±2.74µs        ? ?/sec
run_criteria/yes_using_resource/096_systems    1.01     80.7±4.25µs        ? ?/sec     1.00     80.1±3.64µs        ? ?/sec
run_criteria/yes_using_resource/101_systems    1.00     81.1±4.34µs        ? ?/sec     1.07     87.0±5.21µs        ? ?/sec
run_criteria/yes_with_labels/001_systems       1.08      3.4±0.12µs        ? ?/sec     1.00      3.1±0.29µs        ? ?/sec
run_criteria/yes_with_labels/006_systems       1.04      8.4±0.37µs        ? ?/sec     1.00      8.1±0.48µs        ? ?/sec
run_criteria/yes_with_labels/011_systems       1.00     13.1±0.95µs        ? ?/sec     1.01     13.2±1.09µs        ? ?/sec
run_criteria/yes_with_labels/016_systems       1.04     17.0±1.34µs        ? ?/sec     1.00     16.3±1.49µs        ? ?/sec
run_criteria/yes_with_labels/021_systems       1.04     20.4±1.43µs        ? ?/sec     1.00     19.6±1.44µs        ? ?/sec
run_criteria/yes_with_labels/026_systems       1.01     24.2±1.01µs        ? ?/sec     1.00     23.9±1.44µs        ? ?/sec
run_criteria/yes_with_labels/031_systems       1.05     28.2±1.42µs        ? ?/sec     1.00     26.9±2.15µs        ? ?/sec
run_criteria/yes_with_labels/036_systems       1.02     31.3±1.13µs        ? ?/sec     1.00     30.6±1.75µs        ? ?/sec
run_criteria/yes_with_labels/041_systems       1.00     35.0±1.62µs        ? ?/sec     1.01     35.3±1.70µs        ? ?/sec
run_criteria/yes_with_labels/046_systems       1.01     38.5±2.11µs        ? ?/sec     1.00     38.1±1.62µs        ? ?/sec
run_criteria/yes_with_labels/051_systems       1.00     41.6±2.62µs        ? ?/sec     1.01     42.0±2.02µs        ? ?/sec
run_criteria/yes_with_labels/056_systems       1.09     47.7±2.27µs        ? ?/sec     1.00     43.6±2.05µs        ? ?/sec
run_criteria/yes_with_labels/061_systems       1.01     49.7±2.50µs        ? ?/sec     1.00     49.4±1.87µs        ? ?/sec
run_criteria/yes_with_labels/066_systems       1.04     53.7±4.07µs        ? ?/sec     1.00     51.5±2.43µs        ? ?/sec
run_criteria/yes_with_labels/071_systems       1.03     58.1±2.85µs        ? ?/sec     1.00     56.3±2.35µs        ? ?/sec
run_criteria/yes_with_labels/076_systems       1.03     62.5±2.43µs        ? ?/sec     1.00     60.5±3.38µs        ? ?/sec
run_criteria/yes_with_labels/081_systems       1.00     65.9±3.20µs        ? ?/sec     1.01     66.4±4.00µs        ? ?/sec
run_criteria/yes_with_labels/086_systems       1.00     69.6±2.83µs        ? ?/sec     1.01     70.5±3.78µs        ? ?/sec
run_criteria/yes_with_labels/091_systems       1.04     73.6±3.10µs        ? ?/sec     1.00     71.0±3.00µs        ? ?/sec
run_criteria/yes_with_labels/096_systems       1.00     74.8±3.21µs        ? ?/sec     1.06     79.1±4.74µs        ? ?/sec
run_criteria/yes_with_labels/101_systems       1.00     80.6±2.99µs        ? ?/sec     1.01     81.8±3.73µs        ? ?/sec
schedule/base                                  1.13     23.1±1.47µs        ? ?/sec     1.00     20.5±2.02µs        ? ?/sec
sized_commands_0_bytes/2000_commands           1.00      5.2±0.03µs        ? ?/sec     1.09      5.6±0.01µs        ? ?/sec
sized_commands_0_bytes/4000_commands           1.00     10.2±0.04µs        ? ?/sec     1.10     11.3±0.03µs        ? ?/sec
sized_commands_0_bytes/6000_commands           1.00     15.3±0.07µs        ? ?/sec     1.11     16.9±0.05µs        ? ?/sec
sized_commands_0_bytes/8000_commands           1.00     20.4±0.09µs        ? ?/sec     1.10     22.5±0.07µs        ? ?/sec
sized_commands_12_bytes/2000_commands          1.01      7.4±0.08µs        ? ?/sec     1.00      7.3±0.02µs        ? ?/sec
sized_commands_12_bytes/4000_commands          1.02     14.8±0.07µs        ? ?/sec     1.00     14.5±0.04µs        ? ?/sec
sized_commands_12_bytes/6000_commands          1.01     22.1±0.11µs        ? ?/sec     1.00     21.9±0.09µs        ? ?/sec
sized_commands_12_bytes/8000_commands          1.00     29.4±0.22µs        ? ?/sec     1.01     29.7±0.11µs        ? ?/sec
sized_commands_512_bytes/4000_commands         1.02    111.2±8.69µs        ? ?/sec     1.00    109.4±9.50µs        ? ?/sec
sized_commands_512_bytes/6000_commands         1.01   169.6±20.79µs        ? ?/sec     1.00   168.2±22.06µs        ? ?/sec
sized_commands_512_bytes/8000_commands         1.02   232.7±30.74µs        ? ?/sec     1.00   227.4±33.96µs        ? ?/sec
spawn_commands/2000_entities                   1.00    190.9±6.00µs        ? ?/sec     1.01   191.9±11.22µs        ? ?/sec
spawn_commands/6000_entities                   1.00   577.5±21.36µs        ? ?/sec     1.00   577.8±23.74µs        ? ?/sec
spawn_world/10000_entities                     1.00  1034.2±76.44µs        ? ?/sec     1.00  1031.4±76.62µs        ? ?/sec
spawn_world/1000_entities                      1.03    105.3±7.27µs        ? ?/sec     1.00    102.2±7.02µs        ? ?/sec
spawn_world/100_entities                       1.03     10.7±0.95µs        ? ?/sec     1.00     10.4±0.83µs        ? ?/sec
spawn_world/10_entities                        1.04  1065.2±84.81ns        ? ?/sec     1.00  1023.9±87.52ns        ? ?/sec
spawn_world/1_entities                         1.02    106.5±9.38ns        ? ?/sec     1.00    103.9±7.25ns        ? ?/sec
world_entity/50000_entities                    1.28    121.3±0.72µs        ? ?/sec     1.00     94.5±0.63µs        ? ?/sec
world_get/50000_entities_sparse                1.00    205.8±2.71µs        ? ?/sec     1.01    207.1±2.22µs        ? ?/sec
world_get/50000_entities_table                 1.00    170.1±2.12µs        ? ?/sec     1.11    188.3±1.86µs        ? ?/sec
world_query_for_each/50000_entities_sparse     1.00     47.2±0.35µs        ? ?/sec     1.00     47.5±0.13µs        ? ?/sec
world_query_for_each/50000_entities_table      1.01     27.4±0.10µs        ? ?/sec     1.00     27.1±0.02µs        ? ?/sec
world_query_get/50000_entities_sparse          1.00     95.6±1.14µs        ? ?/sec     1.69    161.1±1.46µs        ? ?/sec
world_query_get/50000_entities_sparse_wide     1.00    196.4±1.67µs        ? ?/sec     1.23    242.0±0.87µs        ? ?/sec
world_query_get/50000_entities_table           1.00    157.4±1.15µs        ? ?/sec     1.27    200.1±0.63µs        ? ?/sec
world_query_get/50000_entities_table_wide      1.00    234.8±1.44µs        ? ?/sec     1.09    255.4±1.16µs        ? ?/sec
world_query_iter/50000_entities_sparse         1.00     53.0±0.19µs        ? ?/sec     1.02     53.9±0.15µs        ? ?/sec
world_query_iter/50000_entities_table          1.01     27.4±0.16µs        ? ?/sec     1.00     27.2±0.08µs        ? ?/sec

@james7132 james7132 changed the title Extend EntityLocation with TableId and Table Row Extend EntityLocation with TableId and TableRow Dec 6, 2022
Copy link
Member

@JoJoJet JoJoJet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive performance wins as always.

crates/bevy_ecs/src/archetype.rs Show resolved Hide resolved
pub fn entity_table_row(&self, index: ArchetypeRow) -> TableRow {
self.entities[index.0].table_row
pub fn entity_table_row(&self, row: ArchetypeRow) -> TableRow {
self.entities[row.index()].table_row
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice little cleanup here.

crates/bevy_ecs/src/entity/mod.rs Outdated Show resolved Hide resolved
crates/bevy_ecs/src/storage/table.rs Show resolved Hide resolved
Co-authored-by: JoJoJet <[email protected]>
Copy link
Member

@BoxyUwU BoxyUwU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine other than these

crates/bevy_ecs/src/world/entity_ref.rs Outdated Show resolved Hide resolved
crates/bevy_ecs/src/world/entity_ref.rs Outdated Show resolved Hide resolved
@BoxyUwU
Copy link
Member

BoxyUwU commented Dec 16, 2022

I don't know what you did but but there are random changes to files and extra commits in this PR now

@james7132
Copy link
Member Author

Sorry, dumb pull config doesn't like how bors merges commits. Should be fixed now.

@JoJoJet JoJoJet added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Dec 31, 2022
@james7132 james7132 added this to the 0.10 milestone Jan 2, 2023
@cart
Copy link
Member

cart commented Jan 2, 2023

bors r+

bors bot pushed a commit that referenced this pull request Jan 2, 2023
# Objective
`Query::get` and other random access methods require looking up `EntityLocation` for every provided entity, then always looking up the `Archetype` to get the table ID and table row. This requires 4 total random fetches from memory: the `Entities` lookup, the `Archetype` lookup, the table row lookup, and the final fetch from table/sparse sets. If `EntityLocation` contains the table ID and table row, only the `Entities` lookup and the final storage fetch are required.

## Solution
Add `TableId` and table row to `EntityLocation`. Ensure it's updated whenever entities are moved around. To ensure `EntityMeta` does not grow bigger, both `TableId` and `ArchetypeId` have been shrunk to u32, and the archetype index and table row are stored as u32s instead of as usizes. This should shrink `EntityMeta` by 4 bytes, from 24 to 20 bytes, as there is no padding anymore due to the change in alignment.

This idea was partially concocted by @BoxyUwU. 

## Performance
This should restore the `Query::get` "gains" lost to #6625 that were introduced in #4800 without being unsound, and also incorporates some of the memory usage reductions seen in #3678.

This also removes the same lookups during add/remove/spawn commands, so there may be a bit of a speedup in commands and `Entity{Ref,Mut}`.

---

## Changelog
Added: `EntityLocation::table_id`
Added: `EntityLocation::table_row`.
Changed: `World`s can now only hold a maximum of 2<sup>32</sup>- 1 archetypes.
Changed: `World`s can now only hold a maximum of 2<sup>32</sup> - 1 tables.

## Migration Guide

A `World` can only hold a maximum of 2<sup>32</sup> - 1 archetypes and tables now. If your use case requires more than this, please file an issue explaining your use case.
@bors bors bot changed the title Extend EntityLocation with TableId and TableRow [Merged by Bors] - Extend EntityLocation with TableId and TableRow Jan 2, 2023
@bors bors bot closed this Jan 2, 2023
bors bot pushed a commit that referenced this pull request Jan 11, 2023
# Objective
Following #6681, both `TableRow` and `TableId` are now part of `EntityLocation`. However, the safety invariant on `EntityLocation` requires that all of the constituent fields are `repr(transprent)` or `repr(C)` and the bit pattern of all 1s must be valid. This is not true for `TableRow` and `TableId` currently.

## Solution
Mark `TableRow` and `TableId` to satisfy the safety requirement. Add safety comments on `ArchetypeId`, `ArchetypeRow`, `TableId` and `TableRow`.
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
# Objective
`Query::get` and other random access methods require looking up `EntityLocation` for every provided entity, then always looking up the `Archetype` to get the table ID and table row. This requires 4 total random fetches from memory: the `Entities` lookup, the `Archetype` lookup, the table row lookup, and the final fetch from table/sparse sets. If `EntityLocation` contains the table ID and table row, only the `Entities` lookup and the final storage fetch are required.

## Solution
Add `TableId` and table row to `EntityLocation`. Ensure it's updated whenever entities are moved around. To ensure `EntityMeta` does not grow bigger, both `TableId` and `ArchetypeId` have been shrunk to u32, and the archetype index and table row are stored as u32s instead of as usizes. This should shrink `EntityMeta` by 4 bytes, from 24 to 20 bytes, as there is no padding anymore due to the change in alignment.

This idea was partially concocted by @BoxyUwU. 

## Performance
This should restore the `Query::get` "gains" lost to bevyengine#6625 that were introduced in bevyengine#4800 without being unsound, and also incorporates some of the memory usage reductions seen in bevyengine#3678.

This also removes the same lookups during add/remove/spawn commands, so there may be a bit of a speedup in commands and `Entity{Ref,Mut}`.

---

## Changelog
Added: `EntityLocation::table_id`
Added: `EntityLocation::table_row`.
Changed: `World`s can now only hold a maximum of 2<sup>32</sup>- 1 archetypes.
Changed: `World`s can now only hold a maximum of 2<sup>32</sup> - 1 tables.

## Migration Guide

A `World` can only hold a maximum of 2<sup>32</sup> - 1 archetypes and tables now. If your use case requires more than this, please file an issue explaining your use case.
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
# Objective
Following bevyengine#6681, both `TableRow` and `TableId` are now part of `EntityLocation`. However, the safety invariant on `EntityLocation` requires that all of the constituent fields are `repr(transprent)` or `repr(C)` and the bit pattern of all 1s must be valid. This is not true for `TableRow` and `TableId` currently.

## Solution
Mark `TableRow` and `TableId` to satisfy the safety requirement. Add safety comments on `ArchetypeId`, `ArchetypeRow`, `TableId` and `TableRow`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective
`Query::get` and other random access methods require looking up `EntityLocation` for every provided entity, then always looking up the `Archetype` to get the table ID and table row. This requires 4 total random fetches from memory: the `Entities` lookup, the `Archetype` lookup, the table row lookup, and the final fetch from table/sparse sets. If `EntityLocation` contains the table ID and table row, only the `Entities` lookup and the final storage fetch are required.

## Solution
Add `TableId` and table row to `EntityLocation`. Ensure it's updated whenever entities are moved around. To ensure `EntityMeta` does not grow bigger, both `TableId` and `ArchetypeId` have been shrunk to u32, and the archetype index and table row are stored as u32s instead of as usizes. This should shrink `EntityMeta` by 4 bytes, from 24 to 20 bytes, as there is no padding anymore due to the change in alignment.

This idea was partially concocted by @BoxyUwU. 

## Performance
This should restore the `Query::get` "gains" lost to bevyengine#6625 that were introduced in bevyengine#4800 without being unsound, and also incorporates some of the memory usage reductions seen in bevyengine#3678.

This also removes the same lookups during add/remove/spawn commands, so there may be a bit of a speedup in commands and `Entity{Ref,Mut}`.

---

## Changelog
Added: `EntityLocation::table_id`
Added: `EntityLocation::table_row`.
Changed: `World`s can now only hold a maximum of 2<sup>32</sup>- 1 archetypes.
Changed: `World`s can now only hold a maximum of 2<sup>32</sup> - 1 tables.

## Migration Guide

A `World` can only hold a maximum of 2<sup>32</sup> - 1 archetypes and tables now. If your use case requires more than this, please file an issue explaining your use case.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective
Following bevyengine#6681, both `TableRow` and `TableId` are now part of `EntityLocation`. However, the safety invariant on `EntityLocation` requires that all of the constituent fields are `repr(transprent)` or `repr(C)` and the bit pattern of all 1s must be valid. This is not true for `TableRow` and `TableId` currently.

## Solution
Mark `TableRow` and `TableId` to satisfy the safety requirement. Add safety comments on `ArchetypeId`, `ArchetypeRow`, `TableId` and `TableRow`.
bors bot pushed a commit to bevyengine/bevy-website that referenced this pull request Mar 6, 2023
## How This Works

For the Bevy 0.10 release blog post (and for the first time ever), I'm publicly opening the doors to other people writing blog post sections. Specifically, if you worked on a feature in a substantial way and are interested in presenting it, you can now ask to claim a section by leaving a comment in this PR. If you claim a section, submit a pull request to the `release-0.10.0` branch in this repo. For the next week, we will be filling in sections (the release target is Saturday March 4th). Please don't claim a section if you don't plan on completing it within that timeline. Also don't claim a section if you weren't an active participant in the design and implementation of the change (unless you are a Maintainer or SME).

I will claim any unclaimed sections.

Try to match the style of previous release blog posts as much as possible.

1. Show, don't tell. Don't bombard people with information. Avoid large walls of text _and_ large walls of code. Prefer the pattern "byte sized description of one thing" -> "example code/picture/video contextualizing that one thing" -> repeat. Take readers on a journey step by simple step.
2. Don't use up reader's "mental bandwidth" without good reason. We can't afford page-long descriptions of minor bug fixes. If it isn't a "headliner change", keep the description short and sweet. If a change is self describing, let it do that (ex: We now support this new mesh shape primitive ... this is what it looks like). If it is a "headliner change", still try to keep it reasonable. We always have a lot to cover.
3. In slight competition with point (2), don't omit interesting technical information when it is truly fun and engaging. A good chunk of our users are highly technical and enjoy learning how the sausage is made. Try to strike a balance between "terse and simple" and "nerdy details".
4. When relevant, briefly describe the problem being solved first, then describe the solution we chose. This contextualizes the change and gives the feature value and purpose.
5. When possible, provide visuals. They create interest / keep people hooked / break up the monotony.
6. Record images and videos at the default bevy resolution (1280x720)
7. Provide an accurate listing of authors that meaningfully contributed to the feature. Try to sort in order of "contribution scale". This is hard to define, but try to be fair. When in doubt, ask other contributors, SMEs, and/or maintainers.
8. Provide numbers and graphs where possible.  If something is faster, use numbers to back it up. We don't (yet) have automated graph generation in blog post style, so send data / info to me (@cart) if you want a graph made.

## Headliners

Headliners are our "big ticket high importance / high profile" changes. They are listed briefly at the beginning of the blog post, their entries are roughly sorted "to the top", and they are given priority when it comes to "space in the blog post". If you think we missed something (or didn't prioritize something appropriately), let us know.

* ECS Schedule v3 (previously known as "stageless")  
* Partial Android Support
* Depth and Normal Prepass
* Environment Map Lighting
* Cascaded Shadow Maps
* Distance and Atmospheric Fog
* Smooth Skeletal Animation Transitions
* Enable Parallel Pipelined Rendering
* Windows as Entities
* Renderer Optimizations
* ECS Optimizations

## Sections

These are the sections we will cover in the blog post. If a section has been claimed, it will have `(claimed by X)` in the title. If it is unclaimed it will have `(unclaimed)` in the title. Let us know if we missed a section. We don't cover every feature, but we should cover pretty much everything that would be interesting to users. Note that what is interesting or challenging to implement is not necessarily something that is relevant to our blog post readers. And sometimes the reverse is true!

If you believe a section should be split up or reorganized, just bring it up here and we can discuss it.

### ~~Schedule V3 (claimed by @alice-i-cecile)~~

* [Migrate engine to Schedule v3][7267]
* [Add `bevy_ecs::schedule_v3` module][6587]
* [Stageless: fix unapplied systems][7446]
* [Stageless: move final apply outside of spawned executor][7445]
* Sets
* Base Sets
  * [Base Sets][7466]
* Reporting
  * [Report sets][7756]
  * [beter cycle reporting][7463]
* Run Conditions
  * [Add condition negation][7559]
  * [And/Or][7605]
  * [Add more common run conditions][7579]
* States
  * [States derive macro][7535]
* System Piping Flexibility
  * [Support piping exclusive systems][7023]
  * [Allow piping run conditions][7547]

### ~~Depth and Normal Prepass (claimed by @IceSentry)~~

* [Add depth and normal prepass][6284]
* [Move prepass functions to prepass_utils][7354]

### ~~Distance and Atmospheric Fog (claimed by @coreh)~~

* [Add Distance and Atmospheric Fog support][6412]

### ~~Cascaded Shadow Maps (claimed by @cart)~~

* [Cascaded shadow maps.][7064]
* [Better cascades config defaults + builder, tweak example configs][7456]

### ~~Environment Map Lighting (claimed by @cart)~~

* [EnvironmentMapLight, BRDF Improvements][7051]
* [Webgl2 support][7737]

### ~~Tonemapping options (claimed by @cart)~~

* [Initial tonemapping options][7594]

### ~~Android support + unification (claimed by @mockersf)~~

* [IOS, Android... same thing][7493]

### ~~Windows as Entities (claimed by @Aceeri)~~

* [Windows as Entities][5589]
* [break feedback loop when moving cursor][7298]
* [Fix `Window` feedback loop between the OS and Bevy][7517]

### ~~Enable Parallel Pipelined Rendering (claimed by @james7132)~~

* [Pipelined Rendering][6503]
* [Stageless: add a method to scope to always run a task on the scope thread][7415]
* [Separate Extract from Sub App Schedule][7046]

### ~~Smooth Skeletal Animation Transitions (claimed by @james7132)~~

* [Smooth Transition between Animations][6922]

### ~~Spatial Audio (claimed by @harudagondi)~~

* [Spatial Audio][6028]

### ~~Shader Processor Features (claimed by @cart)~~

* [Shader defs can now have a value][5900]
* [Shaders can now have #else ifdef chains][7431]
* [Define shader defs in shader][7518]

### ~~Shader Flexibility Improvements (claimed by @cart)~~

* [add ambient lighting hook][5428]
* [Refactor Globals and View structs into separate shaders][7512]

### ~~Renderer Optimizations (claimed by @james7132)~~

* [bevy_pbr: Avoid copying structs and using registers in shaders][7069]
* [Flatten render commands][6885]
* [Replace UUID based IDs with a atomic-counted ones][6988]
* [improve compile time by type-erasing wgpu structs][5950]
* [Shrink DrawFunctionId][6944]
* [Shrink ComputedVisibility][6305]
* [Reduce branching in TrackedRenderPass][7053]
* [Make PipelineCache internally mutable.][7205]
* [Improve `Color::hex` performance][6940]
* [Support recording multiple CommandBuffers in RenderContext][7248]
* [Parallelized transform propagation][4775]
* [Introduce detailed_trace macro, use in TrackedRenderPass][7639]
* [Optimize color computation in prepare_uinodes][7311]
* [Directly extract joints into SkinnedMeshJoints][6833]
* [Parallelize forward kinematics animation systems][6785]
* [Move system_commands spans into apply_buffers][6900]
* [Reduce the use of atomics in the render phase][7084]

### ~~ECS Optimizations (claimed by @james7132 )~~

* [Remove redundant table and sparse set component IDs from Archetype][4927]
* [Immutable sparse sets for metadata storage][4928]
* [Replace BlobVec's swap_scratch with a swap_nonoverlapping][4853]
* [Use T::Storage::STORAGE_TYPE to optimize out unused branches][6800]
* [Remove unnecessary branching from bundle insertion][6902]
* [Split Component Ticks][6547]
* [use bevy_utils::HashMap for better performance. TypeId is predefined …][7642]
* [Extend EntityLocation with TableId and TableRow][6681]
* [Basic adaptive batching for parallel quer- [Speed up `CommandQueue` by storing commands more densely][6391]y iteration][4777]

### ~~Reflect Improvements (claimed by @cart)~~

* [bevy_reflect: Add `ReflectFromReflect` (v2)][6245]
* [Add reflection support for VecDeque][6831]
* [reflect: add `insert` and `remove` methods to `List`][7063]
* [Add `remove` method to `Map` reflection trait.][6564]
* [bevy_reflect: Fix binary deserialization not working for unit structs][6722]
* [Add `TypeRegistrationDeserializer` and remove `BorrowedStr`][7094]
* [bevy_reflect: Add simple enum support to reflection paths][6560]
* [Enable deriving Reflect on structs with generic types][7364]
* [bevy_reflect: Support tuple reflection paths][7324]
* [bevy_reflect: Pre-parsed paths][7321]
* [bevy_ecs: ReflectComponentFns without World][7206]

### ~~AsBindGroup Improvements (claimed by @cart)~~

* [Support storage buffers in derive `AsBindGroup`][6129]
* [Support raw buffers in AsBindGroup][7701]

### ~~Cylinder Shape (claimed by @cart)~~

* [Add cylinder shape][6809]

### ~~Subdividable Plane Shape (claimed by @cart)~~

* [added subdivisions to shape::Plane][7546]

### ~~StandardMaterial Blend Modes (claimed by @coreh)~~

* [Standard Material Blend Modes][6644]

### ~~Configurable Visibility Component (claimed by @cart)~~

* [enum `Visibility` component][6320]

### Task Improvements (claimed by @cart)

* [Fix panicking on another scope][6524]
* [Add thread create/destroy callbacks to TaskPool][6561]
* [Thread executor for running tasks on specific threads.][7087]
* [await tasks to cancel][6696]
* [Stageless: move MainThreadExecutor to schedule_v3][7444]
* [Stageless: close the finish channel so executor doesn't deadlock][7448]

### ~~Upgrade to wgpu 0.15 (claimed by @cart)~~

* [Wgpu 0.15][7356]

### ~~Expose Bindless / Non-uniform Indexing Support (claimed by @cart)~~

* [Request WGPU Capabilities for Non-uniform Indexing][6995]

### ~~Cubic Spline (claimed by @aevyrie)~~

* [Bezier][7653]

### ~~Revamp Bloom (claimed by @JMS55)~~

* [Revamp bloom](bevyengine/bevy#6677)

### ~~Use Prepass Shaders for Shadows (claimed by @superdump)~~

* [use prepass shaders for shadows](bevyengine/bevy#7784)

### ~~AccessKit (claimed by @alice-i-cecile)~~

* [accesskit](bevyengine/bevy#6874)

### ~~Camera Output Modes (claimed by @cart)~~

* [camera output modes](bevyengine/bevy#7671)

### ~~SystemParam Improvements (claimed by @JoJoJet)~~

* [Make the `SystemParam` derive macro more flexible][6694]
* [Add a `SystemParam` primitive for deferred mutations; allow `#[derive]`ing more types of SystemParam][6817]

### ~~Gamepad Improvements (claimed by @cart)~~

* [Gamepad events refactor][6965]
* [add `Axis::devices` to get all the input devices][5400]

### ~~Input Methods (claimed by @cart)~~

* [add Input Method Editor support][7325]

### ~~Color Improvements (claimed by @cart)~~

* [Add LCH(ab) color space to `bevy_render::color::Color`][7483]
* [Add a more familiar hex color entry][7060]

### ~~Split Up CorePlugin (claimed by @cart)~~

* [Break `CorePlugin` into `TaskPoolPlugin`, `TypeRegistrationPlugin`, `FrameCountPlugin`.][7083]

### ~~ExtractComponent Derive (claimed by @cart)~~

* [Extract component derive][7399]

### ~~Added OpenGL and DX11 Backends By Default (claimed by @cart)~~

* [add OpenGL and DX11 backends][7481]

### ~~UnsafeWorldCell (claimed by @BoxyUwU)~~

* [Move all logic to `UnsafeWorldCell`][7381]
* [Rename `UnsafeWorldCellEntityRef` to `UnsafeEntityCell`][7568]

### ~~Entity Commands (claimed by @cart)~~

* [Add a trait for commands that run for a given `Entity`][7015]

* [Add an extension trait to `EntityCommands` to update hierarchy while preserving `GlobalTransform`][7024]
* [Add ReplaceChildren and ClearChildren EntityCommands][6035]

### ~~Iterate EntityRef (claimed by @james7132)~~

* [Allow iterating over with EntityRef over the entire World][6843]

### ~~Ref Queries (@JoJoJet)~~

* [Added Ref to allow immutable access with change detection][7097]

### ~~Taffy Upgrade (claimed by @cart)~~

* [Upgrade to Taffy 0.2][6743]

### ~~Relative Cursor Position (claimed by @cart)~~

* [Relative cursor position][7199]

### ~~Const UI Config (claimed by @cart)~~

* [Add const to methods and const defaults to bevy_ui][5542]

### ~~Examples (claimed by @cart)~~

* [Add pixelated Bevy to assets and an example][6408]
* [Organized scene_viewer into plugins for reuse and organization][6936]

### ~~CI Improvements (claimed by @cart)~~

* [add rust-version for MSRV and CI job to check][6852]
* [msrv: only send a message on failure during the actual msrv part][7532]
* [Make CI friendlier][7398]
* [Fix CI welcome message][7428]
* [add an action to ask for a migration guide when one is missing][7507]

### ~~SMEs (@cart)~~

This was already covered in another blog post. Just briefly call out what they are and that this is the first release that used them. Link to the other blog post.

* [Subject Matter Experts and new Bevy Org docs][7185]

[4775]: bevyengine/bevy#4775
[4777]: bevyengine/bevy#4777
[4853]: bevyengine/bevy#4853
[4927]: bevyengine/bevy#4927
[4928]: bevyengine/bevy#4928
[5400]: bevyengine/bevy#5400
[5428]: bevyengine/bevy#5428
[5542]: bevyengine/bevy#5542
[5589]: bevyengine/bevy#5589
[5900]: bevyengine/bevy#5900
[5950]: bevyengine/bevy#5950
[6028]: bevyengine/bevy#6028
[6035]: bevyengine/bevy#6035
[6129]: bevyengine/bevy#6129
[6179]: bevyengine/bevy#6179
[6245]: bevyengine/bevy#6245
[6284]: bevyengine/bevy#6284
[6305]: bevyengine/bevy#6305
[6320]: bevyengine/bevy#6320
[6391]: bevyengine/bevy#6391
[6408]: bevyengine/bevy#6408
[6412]: bevyengine/bevy#6412
[6503]: bevyengine/bevy#6503
[6524]: bevyengine/bevy#6524
[6547]: bevyengine/bevy#6547
[6557]: bevyengine/bevy#6557
[6560]: bevyengine/bevy#6560
[6561]: bevyengine/bevy#6561
[6564]: bevyengine/bevy#6564
[6587]: bevyengine/bevy#6587
[6644]: bevyengine/bevy#6644
[6649]: bevyengine/bevy#6649
[6681]: bevyengine/bevy#6681
[6694]: bevyengine/bevy#6694
[6696]: bevyengine/bevy#6696
[6722]: bevyengine/bevy#6722
[6743]: bevyengine/bevy#6743
[6785]: bevyengine/bevy#6785
[6800]: bevyengine/bevy#6800
[6802]: bevyengine/bevy#6802
[6809]: bevyengine/bevy#6809
[6817]: bevyengine/bevy#6817
[6831]: bevyengine/bevy#6831
[6833]: bevyengine/bevy#6833
[6843]: bevyengine/bevy#6843
[6852]: bevyengine/bevy#6852
[6885]: bevyengine/bevy#6885
[6900]: bevyengine/bevy#6900
[6902]: bevyengine/bevy#6902
[6922]: bevyengine/bevy#6922
[6926]: bevyengine/bevy#6926
[6936]: bevyengine/bevy#6936
[6940]: bevyengine/bevy#6940
[6944]: bevyengine/bevy#6944
[6965]: bevyengine/bevy#6965
[6988]: bevyengine/bevy#6988
[6995]: bevyengine/bevy#6995
[7015]: bevyengine/bevy#7015
[7023]: bevyengine/bevy#7023
[7024]: bevyengine/bevy#7024
[7046]: bevyengine/bevy#7046
[7051]: bevyengine/bevy#7051
[7053]: bevyengine/bevy#7053
[7060]: bevyengine/bevy#7060
[7063]: bevyengine/bevy#7063
[7064]: bevyengine/bevy#7064
[7069]: bevyengine/bevy#7069
[7083]: bevyengine/bevy#7083
[7084]: bevyengine/bevy#7084
[7087]: bevyengine/bevy#7087
[7094]: bevyengine/bevy#7094
[7097]: bevyengine/bevy#7097
[7185]: bevyengine/bevy#7185
[7199]: bevyengine/bevy#7199
[7205]: bevyengine/bevy#7205
[7206]: bevyengine/bevy#7206
[7248]: bevyengine/bevy#7248
[7267]: bevyengine/bevy#7267
[7298]: bevyengine/bevy#7298
[7311]: bevyengine/bevy#7311
[7321]: bevyengine/bevy#7321
[7324]: bevyengine/bevy#7324
[7325]: bevyengine/bevy#7325
[7354]: bevyengine/bevy#7354
[7356]: bevyengine/bevy#7356
[7364]: bevyengine/bevy#7364
[7381]: bevyengine/bevy#7381
[7398]: bevyengine/bevy#7398
[7399]: bevyengine/bevy#7399
[7415]: bevyengine/bevy#7415
[7428]: bevyengine/bevy#7428
[7431]: bevyengine/bevy#7431
[7444]: bevyengine/bevy#7444
[7445]: bevyengine/bevy#7445
[7446]: bevyengine/bevy#7446
[7448]: bevyengine/bevy#7448
[7456]: bevyengine/bevy#7456
[7463]: bevyengine/bevy#7463
[7466]: bevyengine/bevy#7466
[7481]: bevyengine/bevy#7481
[7483]: bevyengine/bevy#7483
[7493]: bevyengine/bevy#7493
[7507]: bevyengine/bevy#7507
[7510]: bevyengine/bevy#7510
[7512]: bevyengine/bevy#7512
[7517]: bevyengine/bevy#7517
[7518]: bevyengine/bevy#7518
[7532]: bevyengine/bevy#7532
[7535]: bevyengine/bevy#7535
[7546]: bevyengine/bevy#7546
[7547]: bevyengine/bevy#7547
[7559]: bevyengine/bevy#7559
[7568]: bevyengine/bevy#7568
[7579]: bevyengine/bevy#7579
[7594]: bevyengine/bevy#7594
[7605]: bevyengine/bevy#7605
[7639]: bevyengine/bevy#7639
[7642]: bevyengine/bevy#7642
[7653]: bevyengine/bevy#7653
[7701]: bevyengine/bevy#7701
[7737]: bevyengine/bevy#7737
[7756]: bevyengine/bevy#7756


Co-authored-by: François <[email protected]>
Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: Mike <[email protected]>
Co-authored-by: Boxy <[email protected]>
Co-authored-by: IceSentry <[email protected]>
Co-authored-by: JoJoJet <[email protected]>
Co-authored-by: Aevyrie <[email protected]>
Co-authored-by: James Liu <[email protected]>
Co-authored-by: Marco Buono <[email protected]>
Co-authored-by: Aceeri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants