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

[WIP] Various render and event loop optimizations to share #483

Draft
wants to merge 2 commits into
base: canon
Choose a base branch
from

Conversation

ironfroggy
Copy link
Contributor

Not intended as a mergeable pull request (yet?) but a starting point for conversations on event and render loop design.

All these changes got my ~1000 sprite prototype from ~40 fps to ~100 fps

@ironfroggy ironfroggy requested a review from a team as a code owner May 24, 2020 16:49
logger.warning(f"Waited on {self!r} outside of the engine")
return self._future.result(timeout)
try:
return self._cached_result
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should benchmark this independently. We used to do something like this in Vector and found just doing the work was cheaper than the cost of the look-ups.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I definitely would want to benchmark this, but I will at least point out that in any case where we want to cache something doing it with a try/except block is cheaper than a lookup followed by a calculation because it incurs 0 costs on the hit branch. The try-except variant does not have a cost of look-ups, necessarily.

@pathunstrom pathunstrom changed the base branch from master to canon June 27, 2020 11:02
@pathunstrom
Copy link
Collaborator

Noting I'm looking to start poking the various optimizations here and we can start breaking this into separate changes.

@AstraLuma AstraLuma marked this pull request as draft August 13, 2020 00:36
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.

2 participants