bevy/crates
Nicola Papale a634075a39
Inline trivial methods in bevy_hierarchy (#11332)
# Objective

In #11330 I found out that `Parent::get` didn't get inlined, **even with
LTO on**!

This means that just to access a field, we have an instruction cache
invalidation, we will move some registers to the stack, will jump to new
instructions, move the field into a register, then do the same dance in
the other direction to go back to the call site.

## Solution

Mark trivial functions as `#[inline]`.

`inline(always)` may increase compilation time proportional to how many
time the function is called **and the size of the function marked with
`inline`**. Since we mark as `inline` functions that consists in a
single instruction, the cost is absolutely negligible.

I also took the opportunity to `inline` other functions. I'm not as
confident that marking functions calling other functions as `inline`
works similarly to very simple functions, so I used `inline` over
`inline(always)`, which doesn't have the same downsides as
`inline(always)`.

More information on inlining in rust:
https://nnethercote.github.io/perf-book/inlining.html
2024-01-13 22:20:50 +00:00
..
bevy_a11y resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
bevy_animation Skip alloc when updating animation path cache (#11330) 2024-01-13 19:33:11 +00:00
bevy_app resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
bevy_asset Better error message on incorrect asset label (#11254) 2024-01-08 22:45:07 +00:00
bevy_audio resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
bevy_core Replace or document ignored doctests (#11040) 2024-01-01 16:50:56 +00:00
bevy_core_pipeline Revert "Implement minimal reflection probes. (#10057)" (#11307) 2024-01-12 20:41:51 +00:00
bevy_derive Reexport winit::platform::android::activity::* in bevy_winit (#11011) 2023-12-19 20:15:03 +00:00
bevy_diagnostic Replace or document ignored doctests (#11040) 2024-01-01 16:50:56 +00:00
bevy_dylib Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_dynamic_plugin Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_ecs Skip rehashing TypeIds (#11268) 2024-01-13 13:26:43 +00:00
bevy_ecs_compile_fail_tests Rename WorldQueryData & WorldQueryFilter to QueryData & QueryFilter (#10779) 2023-12-12 19:45:50 +00:00
bevy_encase_derive Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_gilrs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
bevy_gizmos resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
bevy_gltf assets should be kept on CPU by default (#11212) 2024-01-05 05:53:47 +00:00
bevy_hierarchy Inline trivial methods in bevy_hierarchy (#11332) 2024-01-13 22:20:50 +00:00
bevy_input Extend Touches with clear and reset methods (#10930) 2024-01-04 23:13:29 +00:00
bevy_internal Revert "Implement minimal reflection probes. (#10057)" (#11307) 2024-01-12 20:41:51 +00:00
bevy_log Print to stderr from panic handler in LogPlugin (#11170) 2024-01-01 17:10:20 +00:00
bevy_macro_utils Replace or document ignored doctests (#11040) 2024-01-01 16:50:56 +00:00
bevy_macros_compile_fail_tests Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_math Implement bounding volume types (#10946) 2024-01-10 23:18:51 +00:00
bevy_mikktspace Update glam, encase and hexasphere (#11082) 2024-01-08 22:58:45 +00:00
bevy_pbr Simplify conditions (#11316) 2024-01-13 13:22:17 +00:00
bevy_ptr Simplify equality assertions (#10988) 2023-12-16 23:58:41 +00:00
bevy_reflect Update glam, encase and hexasphere (#11082) 2024-01-08 22:58:45 +00:00
bevy_reflect_compile_fail_tests Fix nested generics in Reflect derive (#10791) 2023-11-29 01:46:09 +00:00
bevy_render Revert "Implement minimal reflection probes. (#10057)" (#11307) 2024-01-12 20:41:51 +00:00
bevy_scene Change Entity::generation from u32 to NonZeroU32 for niche optimization (#9907) 2024-01-08 23:03:00 +00:00
bevy_sprite assets should be kept on CPU by default (#11212) 2024-01-05 05:53:47 +00:00
bevy_tasks Replace or document ignored doctests (#11040) 2024-01-01 16:50:56 +00:00
bevy_text resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
bevy_time Add paused run condition (#11313) 2024-01-12 22:18:57 +00:00
bevy_transform Rename "AddChild" to "PushChild" (#11194) 2024-01-04 16:06:14 +00:00
bevy_ui resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
bevy_utils Add static assertions to bevy_utils for compile-time checks (#11182) 2024-01-02 22:08:30 +00:00
bevy_window Remove CanvasParentResizePlugin (#11057) 2023-12-21 20:01:22 +00:00
bevy_winit resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00