8000 Improve update_cleared_playfield_tiles performance by boingoing · Pull Request #61 · boingoing/jeznes · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve update_cleared_playfield_tiles performance #61

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 11 commits into from
Jul 1, 2023

Conversation

boingoing
Copy link
Owner
@boingoing boingoing commented Jul 1, 2023

Re-implements update_cleared_playfield_tiles() to walk over the playfield with a single pointer instead of keeping indices. Also optimizes the math and logic as much as I think is possible while keeping it only in C.

This brings the entire sweep from 141747 to 113467 cycles (~20% or ~30000 fewer cycles) in some test scenario. This probably saves a frame or two during the sweep.

Performance while iterating over a completely unmarked playfield improves by about 10%.

Performance while iterating over a playfield with 44 marked tiles improves by about 27%.

The more tiles which are marked, the more noticeable the improvement would be.

@boingoing boingoing merged commit 6256fad into main Jul 1, 2023
@boingoing boingoing deleted the update_cleared_tiles_v5 branch July 1, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0