bevy/crates
Carter Anderson 68606934e3 remove unsafe get_unchecked (and mut variant) from Tables and Archetypes (#1614)
Removes `get_unchecked` and `get_unchecked_mut` from `Tables` and `Archetypes` collections in favor of safe Index implementations. This fixes a safety error in `Archetypes::get_id_or_insert()` (which previously relied on TableId being valid to be safe ... the alternative was to make that method unsafe too). It also cuts down on a lot of unsafe and makes the code easier to look at. I'm not sure what changed since the last benchmark, but these numbers are more favorable than my last tests of similar changes. I didn't include the Components collection as those severely killed perf last time I tried. But this does inspire me to try again (just in a separate pr)! 

Note that the `simple_insert/bevy_unbatched` benchmark fluctuates a lot on both branches (this was also true for prior versions of bevy). It seems like the allocator has more variance for many small allocations. And `sparse_frag_iter/bevy` operates on such a small scale that 10% fluctuations are common.

Some benches do take a small hit here, but I personally think its worth it.

This also fixes a safety error in Query::for_each_mut, which needed to mutably borrow Query (aaahh!).  

![image](https://user-images.githubusercontent.com/2694663/110726926-2b52eb80-81cf-11eb-9ea3-bff951060c7c.png)
![image](https://user-images.githubusercontent.com/2694663/110726991-4c1b4100-81cf-11eb-9199-ca79bef0b9bd.png)
2021-03-11 18:38:22 +00:00
..
bevy_app format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_asset format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_audio Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_core format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_derive format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_diagnostic ♻️ Timer refactor to duration. Add Stopwatch struct. (#1151) 2021-03-05 19:59:14 +00:00
bevy_dylib release 0.4.0 (#1093) 2020-12-19 13:28:00 -06:00
bevy_dynamic_plugin update libloading (#1543) 2021-03-03 03:11:12 +00:00
bevy_ecs remove unsafe get_unchecked (and mut variant) from Tables and Archetypes (#1614) 2021-03-11 18:38:22 +00:00
bevy_gilrs Resolve (most) internal system ambiguities (#1606) 2021-03-10 22:37:02 +00:00
bevy_gltf Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_input format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_internal Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_log Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_math Reflection cleanup (#1536) 2021-03-09 23:39:41 +00:00
bevy_pbr format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_reflect format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_render format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_scene format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_sprite format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_tasks format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_text format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_transform format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_ui format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_utils Update ahash requirement from 0.6.1 to 0.7.0 (#1370) 2021-02-01 13:29:54 -08:00
bevy_wgpu format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_window format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_winit format comments (#1612) 2021-03-11 00:27:30 +00:00