bevyengine / bevyengine/bevy

Improve update_mesh_previous_global_transforms() performance

Open
#14,681 4 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Performance D-Modest S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

* Using try_insert for every entity is expensive. We should have a system to first add PreviousGlobalTransform to entities missing it, and then a second system to update the value. Or something like that.
* When using the meshlet feature, but no motion vector prepass, Mesh entities (not MeshletMesh) unnecessarily get a PreviousGlobalTransform. Not really worth fixing imo, as you probably want to use TAA with meshlets anyways, but I'm making a note of it here.

Contributor guide

Open the contributing guide

Research direction

Locate update_mesh_previous_global_transforms() and inspect how it uses try_insert for each entity. Compare the proposed separate systems for adding missing PreviousGlobalTransform components and updating existing values, while reviewing the meshlet and motion-vector-prepass condition described in the issue. Done means the function's behavior is preserved and its performance is improved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.