bevyengine / bevyengine/bevy

Transform propagation sometimes takes a very long time (300ms+)

Open
#19,411 3 comments 0 reactions 0 assignees View on GitHub
A-Tasks A-Transform C-Bug C-Performance S-Needs-Reproduction
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

0.16.0

## Relevant system information

cargo 1.89.0-nightly (47c911e9e 2025-05-14)
Windows 11

## What you did

Sometimes we move a lot of objects around (floating origin) and need the transforms to be updated for later systems. If we need to move everything we call.

```rust
commands.run_system_cached(bevy::transform::systems::propagate_parent_transforms);
```

After some trial and error and reading the docs, we now call:

```rust
commands.run_system_cached(bevy::transform::systems::mark_dirty_trees);
commands.run_system_cached(bevy::transform::systems::propagate_parent_transforms);
commands.run_system_cached(bevy::transform::systems::sync_simple_transforms);
```

Sadly i was unable to find in which order these should be called.

In 0.15.0 we only scheduled `propagate_transforms`.

## What went wrong

After upgrading to bevy 0.16.0 transform propagation sometimes takes very long (even 300+ms). In 0.15.0 the transform propagation wasn't even something we noticed in tracy.

## Additional information

Screenshot of tracy displaying the time distribution, notice the stragglers at the right.
![Image](https://github.com/user-attachments/assets/8b70034d-99f5-4321-b238-6f1707f5dbaa)

These seem to coincide with the long running transform propagation. Seems odd to have so many threads taking so long.
![Image](https://github.com/user-attachments/assets/61c299b8-6b42-4dab-b622-da020883af81)

Example of a scene:
![Image](https://github.com/user-attachments/assets/1cf62fa5-5255-4b85-9d0a-5d116b9edbc2)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.