Skip to content

Avoid extra cloning on scene impls#23998

Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom
eckz:avoid-clones
Apr 28, 2026
Merged

Avoid extra cloning on scene impls#23998
alice-i-cecile merged 1 commit intobevyengine:mainfrom
eckz:avoid-clones

Conversation

@eckz
Copy link
Copy Markdown
Contributor

@eckz eckz commented Apr 27, 2026

Objective

  • Some code inside the scene.rs contained unnecessary .clone() calls. Most probably because Scene::resolve was not consuming itself before.
  • I'm not sure if this improves anything, as the compiler might be intelligent enough to remove this calls already, but I don't see any drawbacks either.

Solution

  • Remove the .clone() calls when not necessary.

Testing

  • Local unit tests

@greeble-dev greeble-dev added C-Performance A change motivated by improving speed, memory usage or compile times A-Scenes Composing and serializing ECS objects D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 27, 2026
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it C-Code-Quality A section of code that is hard to understand or change and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 28, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 28, 2026
Merged via the queue into bevyengine:main with commit 14f34fa Apr 28, 2026
51 checks passed
@eckz eckz deleted the avoid-clones branch April 28, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Scenes Composing and serializing ECS objects C-Code-Quality A section of code that is hard to understand or change C-Performance A change motivated by improving speed, memory usage or compile times D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants