mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
13570cd4c8
# Objective `Column` unconditionally requires three separate allocations: one for the data, and two for the tick Vecs. The tick Vecs aren't really needed for Resources, so we're allocating a bunch of one-element Vecs, and it costs two extra dereferences when fetching/inserting/removing resources. ## Solution Drop one level lower in `ResourceData` and directly store a `BlobVec` and two `UnsafeCell<Tick>`s. This should significantly shrink `ResourceData` (exchanging 6 usizes for 2 u32s), removes the need to dereference two separate ticks when inserting/removing/fetching resources, and can significantly decrease the number of small allocations the ECS makes by default. This tentatively might have a non-insignificant impact on the CPU cost for rendering since we're constantly fetching resources in draw functions, depending on how aggressively inlined the functions are. This requires reimplementing some of the unsafe functions that `Column` wraps, but it also allows us to delete a few Column APIs that were only used for Resources, so the total amount of unsafe we're maintaining shouldn't change significantly. --------- Co-authored-by: Joseph <21144246+JoJoJet@users.noreply.github.com> |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_ecs_compile_fail_tests | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_macros_compile_fail_tests | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_reflect_compile_fail_tests | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |