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

perf: cache frame and font metrics #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lingsamuel
Copy link
Contributor

This pr made these changes:

  1. Reuse rendered bitmap if the command list has no changes. This can reduce useless re-draw every tick. At worst case it should have same performance just like before.
    Further, we can add another render layer that contains volatile draw calls to ensure the cache are not invalidated by varying data.

  2. Add LRU cache for font:measure().

  3. Returns nil if the file doesn't exist in d2d.Image.new() calls, instead of raises error.

  4. Add some metrics functions.

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