[WIP] Various render and event loop optimizations to share#483
Draft
ironfroggy wants to merge 2 commits into
Draft
[WIP] Various render and event loop optimizations to share#483ironfroggy wants to merge 2 commits into
ironfroggy wants to merge 2 commits into
Conversation
pathunstrom
reviewed
May 24, 2020
| logger.warning(f"Waited on {self!r} outside of the engine") | ||
| return self._future.result(timeout) | ||
| try: | ||
| return self._cached_result |
Collaborator
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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.
Collaborator
|
Noting I'm looking to start poking the various optimizations here and we can start breaking this into separate changes. |
AstraLuma
marked this pull request as draft
August 13, 2020 00:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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