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

Cache individual element paints between renders #73

Open
JoshKarpel opened this issue Dec 29, 2023 · 0 comments
Open

Cache individual element paints between renders #73

JoshKarpel opened this issue Dec 29, 2023 · 0 comments
Labels

Comments

@JoshKarpel
Copy link
Owner

If a component hasn't changed (see #72, which this probably depends on), then we know that the paints of the elements bounded by that component haven't changed either.

  • There is one other thing (other than state changes) that can break this cache: terminal resize events!
  • It seems like the cache needs to live in the shadow tree - I think it is one node per element now, not per component, so that should be straightforward.
  • Not quite sure how to get this information to the painter. Right now it takes a concrete element tree. Should it be inside that data structure, or somehow adjacent? I guess we could use id() as a cache key, since if we have Granular state changes #72 we'd be caching the actual produced element instances.
  • Now that I'm thinking about it, its a little odd to cache at this layer but not at the previous layer (layout). Caching layout is a little tricky because elements can potentially take imperative actions on their parent's layout... does that break this idea? Need to be careful here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant