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

Avoid reading the MDC theme on every composition #3

Merged
merged 3 commits into from
May 6, 2020

Conversation

chrisbanes
Copy link
Contributor

Currently the theme is read on every recomposition, which is obviously very wasteful. Reading from a theme is very slow so we should cache the values when the theme hasn't actually changed.

Theme does not currently implement normal object equality, so we need to use the internal and hidden getKey() method to use as an equality key.

/cc @alanv

@chrisbanes chrisbanes merged commit f77ce99 into master May 6, 2020
@chrisbanes chrisbanes deleted the cb/mdc-theme-cache branch May 6, 2020 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants