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

Limit number of parallel frames being painted #365

Merged
merged 1 commit into from
Aug 11, 2022
Merged

Conversation

rohansingh
Copy link
Member

In #67, we started painting frames in parallel instead of serially, in
order to fully utilize available CPU.

But we did this without any limit. So if a Root had hundreds of frames,
we would attempt to paint all of them in parallel. This would consume
huge amounts of memory by allocating hundreds or thousands of image
buffers.

Instead, we now limit parallelism to the number of CPU's.

In #67, we started painting frames in parallel instead of serially, in
order to fully utilize available CPU.

But we did this without any limit. So if a `Root` had hundreds of frames,
we would attempt to paint all of them in parallel. This would consume
huge amounts of memory by allocating hundreds or thousands of image
buffers.

Instead, we now limit parallelism to the number of CPU's.
@rohansingh
Copy link
Member Author

Tested with a couple apps that paint hundreds of frames (Arcade Classics, Climate Clock). They render just as quickly with this change.

@rohansingh rohansingh merged commit ff21c2c into main Aug 11, 2022
@rohansingh rohansingh deleted the rohan/parallelism branch August 11, 2022 11:45
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