Skip to content

Re-inline QueryManyIter fetch functions - #26040

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
dylansechet:fix_transform_prop_regression
Oct 6, 2026
Merged

alice-i-cecile merged 1 commit into
bevyengine:mainfrom
dylansechet:fix_transform_prop_regression

Conversation

@dylansechet

Copy link
Copy Markdown
Contributor

Objective

Fixes #25840.

Solution

#25200 added wrappers around fetch_next_aliased_unchecked_internal, which is marked as #[inline(always)]. The new wrappers aren't marked as #[inline(always)], so the function stopped getting inlined.

Testing

Ran a couple benchmarks on my laptop, times in μs.

Benchmark Before #25200 main This PR
propagate_parent_transforms/full_recompute_roots_changed 300.6 ± 18.5 389.8 ± 14.7 308.4 ± 21.3
propagate_parent_transforms/full_recompute_leaves_changed 482.0 ± 11.5 575.7 ± 10.7 488.5 ± 8.5
transform_pipeline/localized_updates_static_optimized 428.5 ± 12.6 516.1 ± 16.4 407.4 ± 17.0
transform_pipeline/localized_updates_no_static_optimization 303.4 ± 10.1 395.9 ± 14.1 281.9 ± 14.2

I used a LLM to find the cause of the regression. I then read the #25200 diff to verify its claims and ran the benchmarks.

@dylansechet dylansechet changed the title Inline QueryManyIter fetch functions Re-inline QueryManyIter fetch functions Oct 6, 2026
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Oct 6, 2026
@alice-i-cecile alice-i-cecile added this to the 0.20 milestone Oct 6, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Oct 6, 2026
Merged via the queue into bevyengine:main with commit 1ba0c9f Oct 6, 2026
56 checks passed
mockersf pushed a commit that referenced this pull request Oct 7, 2026
# Objective

Fixes #25840.

## Solution

#25200 added wrappers around `fetch_next_aliased_unchecked_internal`,
which is marked as `#[inline(always)]`. The new wrappers aren't marked
as `#[inline(always)]`, so the function stopped getting inlined.


## Testing
Ran a couple benchmarks on my laptop, times in μs. 

| Benchmark | Before #25200 | main | This PR |
|---|---|---|---|
| propagate_parent_transforms/full_recompute_roots_changed | 300.6 ±
18.5 | 389.8 ± 14.7 | 308.4 ± 21.3 |
| propagate_parent_transforms/full_recompute_leaves_changed | 482.0 ±
11.5 | 575.7 ± 10.7 | 488.5 ± 8.5 |
| transform_pipeline/localized_updates_static_optimized | 428.5 ± 12.6 |
516.1 ± 16.4 | 407.4 ± 17.0 |
| transform_pipeline/localized_updates_no_static_optimization | 303.4 ±
10.1 | 395.9 ± 14.1 | 281.9 ± 14.2 |

---
I used a LLM to find the cause of the regression. I then read the #25200
diff to verify its claims and ran the benchmarks.
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 D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Transform Propagation Perf Regressions

3 participants