Skip to content

perf: cache frame and font metrics#16

Open
lingsamuel wants to merge 4 commits intocursey:mainfrom
lingsamuel:images
Open

perf: cache frame and font metrics#16
lingsamuel wants to merge 4 commits intocursey:mainfrom
lingsamuel:images

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.

Signed-off-by: LingSamuel <lingsamuelgrace@gmail.com>
Signed-off-by: LingSamuel <lingsamuelgrace@gmail.com>
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