Skip to content
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

Refactor check_light_mesh_visibility for performance #1 #13905

Merged
merged 5 commits into from
Jun 18, 2024

Conversation

re0312
Copy link
Contributor

@re0312 re0312 commented Jun 18, 2024

Objective

Solution

  • split check_light_mesh_visibility into check_dir_light_mesh_visibility and check_point_light_mesh_visibility for better review

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times C-Code-Quality A section of code that is hard to understand or change S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 18, 2024
This reverts commit 6ce8c81.
check_light_mesh_visibility
(
check_dir_light_mesh_visibility,
check_point_light_mesh_visibility,
Copy link
Member

Choose a reason for hiding this comment

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

Do these systems need to be ordered relative to each other?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should not be necessary. The main reason for splitting the system is that in subsequent PRs, we hope they can be automatically parallelized by the bevy's scheduler.

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

I've checked this over, and the refactoring / splitting appears to be done correctly. The core idea for why this should be done also makes sense to me :)

@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 Jun 18, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 18, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 18, 2024
Merged via the queue into bevyengine:main with commit 91cd84f Jun 18, 2024
28 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jun 26, 2024
# Objective

- Second part of #13900 
- based on #13905 

## Solution

- check_dir_light_mesh_visibility defers setting the entity's
`ViewVisibility `so that Bevy can schedule it to run in parallel with
`check_point_light_mesh_visibility`.

- Reduce HashMap lookups for directional light checking as much as
possible

- Use `par_iter `to parallelize the checking process within each system.

---------

Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com>
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-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 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