Skip to content

Parallelize bevy 0.16-rc bottlenecks #18632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 31, 2025

Conversation

aevyrie
Copy link
Member

@aevyrie aevyrie commented Mar 30, 2025

Objective

  • Found stuttering and performance degradation while updating big_space stress tests.

Solution

  • Identify and fix slow spots using tracy. Patch to verify fixes.

Testing

  • Tracy
  • Before:
    image
  • prev_gt parallelization and mutating instead of component insertion:
    image
  • parallelize visibility ranges and mesh specialization
    image

@aevyrie
Copy link
Member Author

aevyrie commented Mar 30, 2025

This is an ad-hoc accumulation of perf fixes, might need to split things out. Duplication with #18618

@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Mar 30, 2025
Copy link
Contributor

@bushrat011899 bushrat011899 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! One minor suggestion but generally agreeable.

@bushrat011899 bushrat011899 added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times X-Uncontroversial This work is generally agreed upon D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 31, 2025
@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 and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 31, 2025
JMS55
JMS55 previously requested changes Mar 31, 2025
Copy link
Contributor

@JMS55 JMS55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to request changes, not approve*

Co-authored-by: Zachary Harrold <zac@harrold.com.au>
@aevyrie aevyrie requested a review from JMS55 March 31, 2025 05:02
@aevyrie
Copy link
Member Author

aevyrie commented Mar 31, 2025

I don't see why this is blocking, there is no downside to keeping this as-is. I'd argue changing it would make this more brittle. (It seems out of scope too? I'm just doing the minimum to match the existing code but make it parallel)

@alice-i-cecile alice-i-cecile dismissed JMS55’s stale review March 31, 2025 18:31

This is a straightforward improvement; other cleanup can wait.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 31, 2025
Merged via the queue into bevyengine:main with commit d09f958 Mar 31, 2025
32 checks passed
mockersf pushed a commit that referenced this pull request Mar 31, 2025
# Objective

- Found stuttering and performance degradation while updating big_space
stress tests.

## Solution

- Identify and fix slow spots using tracy. Patch to verify fixes.

## Testing

- Tracy
- Before: 

![image](https://github.com/user-attachments/assets/ab7f440d-88c1-4ad9-9ad9-dca127c9421f)
- prev_gt parallelization and mutating instead of component insertion: 

![image](https://github.com/user-attachments/assets/9279a663-c0ba-4529-b709-d0f81f2a1d8b)
- parallelize visibility ranges and mesh specialization

![image](https://github.com/user-attachments/assets/25b70e7c-5d30-48ab-9bb2-79211d4d672f)

---------

Co-authored-by: Zachary Harrold <zac@harrold.com.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants